tempfile: do not delete tempfile on failed close