Resolve a race condition in GDKcreatedir.
Resolve a race condition in GDKcreatedir.

If two threads simultaneously try to create a new file in the same not
yet existing directory, the two threads both call GDKcreatedir to
create the directories leading up to the file.  Only one succeeds, and
the other thread fails, leading ultimately to failure to create the
file (we check error returns! :-).
So what we do now is after mkdir fails we check whether the directory
exists after all, and if so, do as if mkdir succeeded.

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb