Rework mkdir_p to be more resistant to races.
Rework mkdir_p to be more resistant to races.

Basically, we have to account for the fact that the directory
might have been created between the check (os.access) and the
actual makedirs call.  What that actually leads to is the
realization is that we should just do the os.makedirs(), and
suppress the error if the directory exists and is a directory.
All other problems get thrown as exceptions.

Signed-off-by: Chris Lalancette <60b62644009db6b194cc0445b64e9b27bb26433a@redhat.com>

ndonegan/oz,NeilBryant/oz,moofrank/oz,mgagne/oz,cernops/oz,imcleod/oz,cernops/oz,mgagne/oz,imcleod/oz,nullr0ute/oz,clalancette/oz,NeilBryant/oz,clalancette/oz,ndonegan/oz,moofrank/oz,nullr0ute/oz