Add a PHP-agnostic version of `array_replace_recursive()` in `BP_Activity_Activity`

r9257 implemented the ability to query activity items by multiple scopes.
`array_replace_recursive()` is a function that is used in the above commit
to help override certain arguments in the activity loop by scopes. However, `array_replace_recursive()` is a PHP 5.3 function and BuddyPress (and
WordPress) currently supports a minimum version of PHP 5.2.

This commit adds a PHP-agnostic version of `array_replace_recursive()` for
internal use by the `BP_Activity_Activity` class.  This helps to avoid
fatal errors for those using PHP 5.2 and to fix up our unit tests.

Anti-props r-a-y.

See #4988.

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