Fix a memory leak in TempFile

Summary: It seems like opening a file with fdopen() and closing it with close()
leaks the FILE structure.

Reviewed By: @ptarjan

Differential Revision: D1494494