Introduce bp_core_get_upload_dir().

This function fetches data from the BP root blog's upload directory.

Handy for multisite instances because all uploads are made on the BP root
blog and we need to query the BP root blog for the upload directory data.

This ensures that we only need to use switch_to_blog() once to get what we
need.

Use this function in bp_core_avatar_upload_path() and bp_core_avatar_url().

Fixes #4948.

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