fixes for user_data having keys with None values

http://manage.dimagi.com/default.asp?132271
http://manage.dimagi.com/default.asp?132268
Merge pull request #4213 from dimagi/bihar-fixes

fixes for user_data having keys with None values