In `bp_core_load_template()`, reset post globals if we're on a non-directory page.

If we're on a non-directory page, we are faking a WordPress page, so we
must reset the WordPress post globals to avoid notices from appearing.  The
reset is done with the `bp_theme_compat_reset_post()` function and notably
fixes notices when the root profiles feature is toggled.

Commit also removes an unnecessary database query to determine whether
we're on a BuddyPress directory page.  WordPress should have already made
this determination before BuddyPress has reached this point in
`bp_core_load_template()`.

Fixes #5241.

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