Here is an example failure on AppVeyor (Windows):
Similar failure on Linux, showing the line number:
The erroring line number (467) corresponds to the OpenOutputStream call below:
It's not obvious why the error occurs, since the directory is created just above (race condition in the CreateDir implementation?).