tried to fix a race condition in parallel builds

 * testing for directory existence and then calling mkdir may fail in
   the mkdir when a different process has created the directory in the
   time between invoking test and mkdir

Summary: tried to fix a race condition in parallel builds

Test Plan: none -- threading issue, working parallel build does not mean anything

Reviewers: davidb, joa, lisbethb

Reviewed By: lisbethb

Differential Revision: https://phab.met.no/D17