[FLINK-1215] Fix spurious failures when creating output directories due to I/O races