Update utils.py for non-int/uuid id names

For ldap backends, the id could be just a username. As such, we should try to lookup the user by a string name_or_id.