Fix logic to validate usernames.

Will check existing accounts for clashes.

Will not generate error if renaming person with username to ABC and
person already has an account with username ABC.

Change-Id: I9823ef3006e0dcad01d2d71b40fee913a10266ba