On BuddyPress pages, make sure the edit link is not displayed if the corresponding post ID is not set

This prevents the edit link to show at the bottom of BuddyPress pages and allow plugins to get an edit link in case they are using it (providing a post ID) in a BuddyPress page.

Fixes #5853

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