[BI-334]close streams in finally block