Explicitly fclose() in file_{get,set}_contents()

to avoid needlessly running into open file descriptor limits when
relying on the GC to close files.