Make sure xprofile_sync_bp_profile() happens when a user is edited

Bring back checks on the $update var and WordPress error that were removed in r8810 so that the xProfile sync only happens when a user is edited. Add a unit test.

Props boonebgorges

Fixes #5836

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