Fix cleanup when no temporary file was created