Do not delete temp files on error (fixes #849)

For review, because I am afraid the removal there might have a specific purpose which I am not understanding.