Fix obvious issues when build by Visual Studio 2005

Greetings.

I've built libmodbus with Visual Studio 2005 and by the way have fixed some issues. They are concerning a) compilation and b) prolonged connection phase on nonblocking socket.

I hope this patch would be useful.