ENH: more robust checking for a username/uid