Fix typo in ioctlsocket parameter
Fix compile warnings and errors on MSVC