Add logic to detect whether a file was written to when creating a new
document and aborts the save of the new document if the file was not
written.