HHH-9422 Making sure opened streams are closed