Remove temporary file at safeWriteToFile()