Better deadlock prevention

- Locks are placed on UserGroup rows so that simultaneous update does not occur
- UserGroupDAO is now in charge of creating a corresponding row in the parents cache when a new user is created