BZ-1063436: avoid double commits by checking if file exists instead of createFile