Add an overall timeout on CAP negotiation

At the moment it just hangs if the server doesn't support CAP. This adds
a 15 second timeout to the CAP negotiation process, after which the
connection continues.

The timeout and error on failed SASL negotiation is preserved.
1 file changed