Fix high CPU use on Windows when connecting to a server

When getting a write event for an EventHandler that wanted a single write only, remove it from the WriteSet (socketengine_select)

Fixes #556 reported by @WindowsUser
m_spanningtree FJOIN handler: Merge and take maxmodes into consideration when applying non-prefix modes
Prevent m_cgiirc from blocking indefinitely, resulting in registration timeouts on e.g. Mibbit when webirc is not used
Merge pull request #563 from ElementalAlchemist/patch-1

Prevent m_cgiirc from blocking indefinitely
Fix low risk crash when we can't determine maximum open socket count.
Fix the Poll socket engine on BSD.
Do not send too much data over SSL in one go

Some clients fail to read it entirely and the remaining data stays in their read buffer until new data arrives
m_userip Fix incorrect "variable may be used uninitialized" warning shown by older GCC versions
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
m_ssl_openssl Fix inverted check that prevented certificates from being recognized as trusted
Fix generated snomask mode change string being incosistent with the input in certain cases, spotted by @Robby-
Use server ids when propagating squits
m_ssl_gnutls Fix feature testing and cipher suite related errors on older GnuTLS versions

Use the (old) LIBGNUTLS_VERSION_* defines as a fallback when GNUTLS_VERSION_* is unavailable

Fixes #595 reported by @rhylan
m_dnsbl Fix possible use-after-free after a rehash
m_spanningtree When an IOHook goes away close all pending connections that use it
Make all regex modules throw the same exception on error.
Fix various small issues.

- Add CXX11_OVERRIDE to *Regex::Matches and *RegexFactory::Create.
- Fix documentation comment on regex_string.
- Fix various code duplication/layout issues.
Merge pull request #619 from SaberUK/master+regex-dedupe

Various regex module improvements.