Remove dead store.
Remove call to mailimap_unsubscribe right after the call to mailimap_subscribe.

It just doesn't make any sense the way it was.  It was added in
854827d81f59f, "Removed use of exceptions completely from MailCore".
I think it's just a copy-paste error.
Fix object leak on error path.
Fix potential evaluation of garbage value.
Add null check.