prevent nomethod error when closing a stream that never opened