Close input file on error.