More conservative page_template checks in bp_is_current_component()

The page_template checks in bp_is_current_component() should not go through if
the currently queried object is not a single page (ie when a plugin is forcing
it to be a CPT archive). So we check for the presence of the `ID` property
before attempting to use it.

Fixes #5751

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