Fixes an error and handles cross-domain fixture upload errors

Fixes http://manage.dimagi.com/default.asp?67007#381789 (exception on main site).