Close input file immediately after reading.