changerd __del__ to close the tmp file before attempting to unlink it. This is required on windows, and probably wise on all platforms.