Use new synchronization helpers to avoid races when deploying with HA

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

 - when creating of the database / database user

Ideally, we would also do that for the db sync, but it's not possible
because this happens in a notification. It should be fine, though, as
the first sync for the database should give enough advance time to the
cluster founder to avoid an issue there.
Merge pull request #146 from vuntz/sync-marks

Use new synchronization helpers to avoid races when deploying with HA