Rip the STARTTLS stuff out of tls.el again, and just bind it directly from nnimap.