fixing a msvc network bug.

on visual sudio 2010 errno and EWOULDBLOCK are both defined, but don't work properly. So i changed the code into using WSAGetLastError over errno if available.