Added clean up code to WinSock version check

The cleanup() function has been added to the WinSock version check code
to ensure that in the event of library mismatch, WSACleanup() is called