prevent closing modal during upload

http://manage.dimagi.com/default.asp?113695
I have no better solution at present, so merging.