Fix segfault due to deleted pruneTree call

Commit faea6a3132fe78fd25e84e7adeeb3edddb89b46b changed the behavior, some of
the messages still in the tree might now have a null pointer to the original
TreeItemMessage. I've hit this assert myself when switching mailboxes (but only
after a couple days).