Atomically add users. Addresses #1834

Atomically add users. This is done by always adding a user when requested, and then assuming the database’s auto increment function is atomic. If it is, and there is more than one user, the user's id will not be 1. In that case, delete the new user.