I finally got some time to package the code into a plugin which you can download at the WordPress Plugins repository. Give it a spin and let me know how it fairs in your particular setup. The plugin should be ok on WordPress 3.2.1 to 3.8.1 running BuddyPress 1.5 to 1.9.2
Thanks very much for all the feedback I got in the comments on the behaviour of the code.
Plugin en el español (http://wordpress.org/plugins/buddypress-xprofile-image-field/) por Andrew de WebHostingHub. Gracias Andrew!