Close resource leak in temporary file manager.
Merge pull request #747 from mtbc/tempfilemgr-leak

Close resource leak in temporary file manager.