Close/delete tempfile properly (windows)