Fix some issues with event handling loop

1. Fix incorrectly inflating max fd for disconnected sockets which are not set in the fd set passed to select. Not usually a problem, but sometimes max fd can end up very large (> 16,000,000) and cause select to return an error.
2. Error spam on Win32 (possibly other platforms) when calling xmpp_run_once on a context that does not currently have any open connections.