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 <trond.norbye@gmail.com>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>