catch exception if tried to stop not running loop
Fix incoming processing mail.

The deferred was not working properly so messages in the incoming queue
were not being processed.
Merge remote-tracking branch 'kali/bug/fix-imap-incoming-processing-r2' into develop
Check for str or unicode for the cert/key fields