Fix low risk crash when we can't determine maximum open socket count.
Fix the Poll socket engine on BSD.
Merge pull request #588 from SaberUK/insp20+fix-socketengines

[2.0] Fix various socket engine bugs.
Clean up error handling in threadengine_win32
Use the correct socket related error messages on Windows