Introduce metadata pre-fetching for xprofile objects

XProfile objects (groups, fields, and data) are generally fetched in a nested
way, as within the context of a bp_has_profile() loop. Thus, it makes sense to
pre-fetch xprofile metadata within a bp_has_profile() loop in a nested way as
well. This changeset introduces bp_xprofile_update_meta_cache(), which is able
to fetch all uncached metadata for nested meta types with a single database
query.

This changeset also introduces an 'update_meta_cache' parameter to the
bp_has_profile() stack. This param allows developers to disable the pre-
fetching introduced here. Defaults to true.

See #5398

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