Cache the unread inbox count for a user.

This commit:
- Caches calls to BP_Messages_Thread::get_inbox_count()
- Invalidates the cache when a new message is sent or deleted
- Adds a unit test

See #5414

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