Fix issue where multiple threads try to create same directory at the sam...

...e time