Reduce CPU consumption of event loop
Reduce CPU consumption of event loop

The do {} while is changed to a while loop to avoid calling
sendmsg the first time if there isn't any things to be sent
(we use write availability to trigger callbacks during
backoff from multiple readers)

Change-Id: I37a7fe1ef45f846f5ce69f25c62078c93bf7f061
Reviewed-on: http://review.couchbase.org/23742
Tested-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>
Reviewed-by: Sergey Avseyev <87f6d5e4fd3644c3c20800cde7fd3ad1569370b3@gmail.com>

couchbase/libcouchbase,kojiromike/libcouchbase,avsej/libcouchbase,mnunberg/libcouchbase,mody/libcouchbase,PureSwift/libcouchbase,mnunberg/libcouchbase,maxim-ky/libcouchbase,couchbase/libcouchbase,couchbase/libcouchbase,avsej/libcouchbase,uvenum/libcouchbase,avsej/libcouchbase,trondn/libcouchbase,mnunberg/libcouchbase,couchbase/libcouchbase,kojiromike/libcouchbase,signmotion/libcouchbase,uvenum/libcouchbase,kojiromike/libcouchbase,uvenum/libcouchbase,mody/libcouchbase,uvenum/libcouchbase,maxim-ky/libcouchbase,senthilkumaranb/libcouchbase,PureSwift/libcouchbase,maxim-ky/libcouchbase,trondn/libcouchbase,senthilkumaranb/libcouchbase,PureSwift/libcouchbase,mody/libcouchbase,maxim-ky/libcouchbase,kojiromike/libcouchbase,signmotion/libcouchbase,avsej/libcouchbase,mnunberg/libcouchbase,avsej/libcouchbase,signmotion/libcouchbase,signmotion/libcouchbase,mnunberg/libcouchbase,senthilkumaranb/libcouchbase,couchbase/libcouchbase,avsej/libcouchbase,uvenum/libcouchbase,couchbase/libcouchbase,trondn/libcouchbase,mody/libcouchbase,senthilkumaranb/libcouchbase,couchbase/libcouchbase,PureSwift/libcouchbase,trondn/libcouchbase,trondn/libcouchbase,avsej/libcouchbase