I investigated this a bit, and it seems to me the real problem here is that Java's mkdirs does not explain why the directory could not be made. Typically the way to overcome a race for a mkdir is to check for EEXIST and if that's the error, then continue with no error, because we know that the other process won the race.
java.nio.path.createDirectories will throw FileAlreadyExistsException when it loses the race.
I see that other code in that repo already uses java.nio, so I guess converting from mkdirs to createDirectories would be possible.
Hope this is helpful!