imap: Added custom request perform and response handler functions

Added imap_custom(), which initiates the custom command processing,
and an associated response handler imap_state_custom_resp(), which
handles any responses by sending them to the client as body data.

All untagged responses with the same name as the first word of the
custom request string are accepted, with the exception of SELECT and
EXAMINE which have responses that cannot be easily identified. An
extra check has been provided for them so that any untagged responses
are accepted for them.
imap: Enabled custom requests in imap_perform()

Modified imap_perform() to start with the custom command instead of
SELECT when a custom command is to be performed and no mailbox has
been given.
imap: Enabled custom requests in imap_select_resp()

Changed imap_select_resp() to invoke imap_custom() instead of
imap_fetch() after the mailbox has been selected if a custom
command has been set.
imap: Fixed custom request handling in imap_done()

Fixed imap_done() so that neither the FINAL states are not entered when
a custom command has been performed.