Add support to automatically validate SSL connections' certificates

This finally adds support to validate SSL connections using trusted CA
certificates installed in the system, usually in /etc/ssl/certs.  So the
user doesn't have to manually accept and store certificates for most
IMAP servers.
Add option to disable re-entering IDLE mode after connection recovery.