Handle directory creation race condition.
Merge pull request #743 from rhattersley/makedirs-race-fix

Handle directory creation race condition.