Fix calls to file:close

file.close does not seem to work for me (lua 5.1.4), I checked with lsof and file:close does not seem to leak file descriptors.