In `messages_format_notifications()`, check that thread ID exists before attempting to link to it. Fixes debug notices and incorrect links when a message thread is deleted before notifications are marked as read.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8616 cdf35c40-ae34-48e0-9cc9-0c9da1808c22