fix issues with mismatch between casing in user_id retrieved from couch ...

...and es


http://manage.dimagi.com/default.asp?74872#430215