Close fd again after opening with mkstemp

Fixes #155
Merge pull request #156 from guidow/fd_leak_fix

Close fd again after opening with mkstemp