406813: ImapAdapter: 6 Issues

https://bugs.eclipse.org/bugs/show_bug.cgi?id=406813
NPE fixed