MB-11342: Check if the stream is dead before inserting an item

There is a race condition where an item can be added into a
PassiveStream even after the stream has been set to dead. This can
happen because we do not hold a lock when getting a stream in the
UprConsumer.

Change-Id: Ib557020873d4ce51b9994b002689408010571689
Reviewed-on: http://review.couchbase.org/37968
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-11342: Make all PasiveStreams dead before deleting an UprConsumer

Since we check that the flow control buffers are cleared before we
delete a PassiveStream we need to set the streams to dead before we
delete them.

Change-Id: I69926268c1f823764f32c9b0b3c4a9ba73c3564d
Reviewed-on: http://review.couchbase.org/37969
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>