imap.c: Fixed unnecessary state change if starttls fails

The state machine should only be changed to IMAP_STARTTLS when the
STARTTLS command has been successfully sent to the server.