Close streams correctly in IngestOcrUtils