Add -open and -close methods to client

There's no way to open or close the connection. We add methods to
MXMIMAPClient which allows the caller to open or close the connection.
If the connection is set to use TLS then the TLS session is opened if
the connections succeeds.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>
Disconnect when the remote endpoint hang up

We do not detect when the remote endpoint has closed the connection.
This creates an infinite loop where -readMore is called from the run
loop. Detect if the connection has closed and disconnect on our end.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>
Parse capabilities in capability reply

Parse the capability reply by separating the text section into space
separated components, and an empty array if there are no capabilities.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>