Move role revision updates to a separate method
Use proper locking for node allocation

save is refactored to accept a code block that needs to be
protected with the role lock. Make use of that in allocate
and convert usages of previous allocate functions accordingly.
Use locking for updating the description