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.