[bugfix] Handle conflicting user ids when restoring a backup:

1. avoid lost user ids: if an account in the backup has the same name as an existing user, but a different user id: update the account but keep the old user id. Not doing so led to corrupted resources/collections: resources still referenced the old, deleted user id.

2. avoid duplicate users: if an account in the backup uses a different name, but the same id as an existing user: assign a new id to the user account before restoring it.