retry when getting mysql duplicate entry errors on first_or_create

Solve the UserLevel first_or_create race condition (which can happen when the run button is "double clicked") on the server side.