When prefetching group data for an activity loop, avoid the query when there's nothing to fetch

When there are no uncached_ids, don't attempt to query. There's nothing to get,
and it will result in an invalidly formatted SQL query.

Fixes #5503

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