Introduce bp_group_is_invited(), and use it to improve private group message for non-members

When non-member visits a private group of which she is not a member, she now
sees a message that tells her to accept her pending invitation.

Fixes #5510

Props hnla

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