Some cleanup and make sure the file we read is closed after we generate
the response.