Initialize winsock and call closesocket rather than close in the client.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>