Fix unresolved references to closesocket(), etc on Windows