added exception handling to tempfile contextmanager
Merge pull request #1713 from twobraids/delete-the-temp

Fixes Bug 946875 - added exception handling to tempfile contextmanager