Product uploader fixes

fixes a few serious issues in the product uploader (enumerated in the commits)

reported bug was http://manage.dimagi.com/default.asp?124663 but turns out we also just weren't saving products when they weren't a multiple of 500 (including when there were fewer than 500)
yes, that was intentional. the exception handling logic wasn't smart enough to give correct UI feedback when the save failed, and I think making the "write to db" bit actually fail hard in a way separate from "that product code is invalid" is reasonable.