Handle unacked bytes when closing a stream

Whn we close a streamt here may be some items that we weren't able
to process. We need to make sure that these items are accounted for
in free bytes so that flow control doesn't get out of sync.

Change-Id: I7b220cc574599c856aa040030c77ef442a4c922a
Reviewed-on: http://review.couchbase.org/37920
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-11298: Allow upr to send bytes past the buffer threshold

If we have an item that is larger than the buffer size specified by
the client then in the current code we must wait for the buffer to
drain before we send that item. This makes it difficult for a client
to control when to send a buffer ack because if we have a really small
item followed by a really big item then the consumer might wait for
the producer to send more items and the producer will wait for the
consumer to ack what it has leading to a deadlock.

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