Allow changing only the case of user names

Currently, if you try to change only the case of a username (for instance, from admin to Admin), you'll receive the error message "The username '%s' already exists".
With this edit we'll let changing the case.

As a further minor improvement, the check if the username is unique is done only if the username changes (before it was always performed).