wfMkdirParents: recover from mkdir race condition

If mkdir fails, check again to see if dir has been created
since our initial check, and return true if so.

Also, in initial check, only return true if $dir is really
a directory, not a file.

Bug: 49391
Change-Id: I2b331669fae70948ce79ba1477c05968a3095c3d
Merge "wfMkdirParents: recover from mkdir race condition"