This only happens the first time that a directory is missing; obviously the first call to create the directory as part of `abc/def.txt` in the example above will result in it not being an issue the second time around.
I've tested this change against a normal build (where no new directories were introduced) and nothing broke, so worst case scenario we're in no better position than we started with (but I am fairly confident that this is the correct fix for the issue).