Ensure stream is being closed.