extend and cleanup use of closesocket()

1st commit:
rework closesocket()

- make closesocket() the pure Win32 API call on Win32
- make closesocket() emulate the Win32 behaviour on all other OSes

2n commit:
 extend and cleanup use of closesocket()

- add missing closesocket() calls for BindListenPort()
- always call closesocket() before printing any text (ensure consistent
  usage in the code)

misc small changes in net:
- remove unused CNode::Cleanup()
- add missing vhListenSocket.clear() to ~CNetCleanup()

changes in ConnectSocketDirectly() unrelated to closesocket():
- replace 3 following calls to WSAGetLastError() by storing result into
  nErr and use this in an if-clause
- convert an if() to an else if(), which removes an unneded check if the
  first case is true
For large types such as structures and objects that can be true (but then we'd use a *const* reference). For small types like integers and handlers it's only overhead. On 64-bit architectures a pointer to an integer is larger than the integer itself.