close the temp file handle returned by mkstemp

Otherwise we are leaking open file handles and run out of them at some point.
Merge pull request #204 from tjhei/fix_open_viz_files

close the temp file handle returned by mkstemp