Use new synchronization helpers to avoid races when deploying with HA

There are a number of possible races when deploying keystone for the
first time:

 - when creating of the database / database user
 - when finding the PKI info so it's the same on all nodes
 - when registering the endpoint and creating users in keystone
Merge pull request #200 from vuntz/sync-marks

Use new synchronization helpers to avoid races when deploying with HA