make device_users return only distinct usernames

also possibly improve performance insignificantly

Tested this cursorily on staging.

fixes: http://manage.dimagi.com/default.asp?105748