MB-11948: Handle GetLastError() returning 0 condition

In windows, the GetLastError() call sometimes returns 0 instead of
the returning WSAEWOULDBLOCK. Either the error gets reset before
the invocation or it could be undefined behavior.

Change-Id: Ifb8f7d576b447d090b21cc0747d068ead0597182
Reviewed-on: http://review.couchbase.org/40865
Reviewed-by: abhinav dangeti <abhinav@couchbase.com>
Reviewed-by: Sundararaman Sridharan <sundar@couchbase.com>
Tested-by: Sriram Ganesan <sriram@couchbase.com>