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)
May not matter, but previously `val` was always unicode. Now if `row` does not contain `attr` it will be a str. Maybe should be
```python
val = row.get(attr, u'')
```