Make owner_id select a little less brittle

Don't crash if a case has no owner_id and/or user_id set

Fixes http://manage.dimagi.com/default.asp?62676