Improved Dispose() handling for InternalStream