MODE-2252: Fixes creating large numbers of directories or files in the same directory