Closes input file on exit