Fixed error handling for ext/sockets under win

WSAGetLastError() must be the very next call after a socket
function had an invalid return. Any function call inbetween
will clear the error information.
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  Fixed error handling for ext/sockets under win