CCBC-175 Work properly on systems where EWOULDBLOCK != EAGAIN

Fixes issues on HP-UX

Change-Id: I2108216c5764f42759292a185e44de5af946ed20
Reviewed-on: http://review.couchbase.org/24448
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>