IMAP IDLE Support

I've added IMAP IDLE support without (hopefully) changing too much on base functionality.
IMAP IDLE can be used with the --imap_idle commandline flag.

IDLE is started before smtp message is sent and tracks the time untill the message appears in the INBOX more precise.

I've restructured the "check" function a bit to get IDLE support in.