Fix race condition in relation state handling
Make sure we use the same timestamp to insert the new
syncroton_relations_state entry even if we execute this multiple times.
Not using a current timestamp and instead using the sync timestamp
isn't strictily necessary, but makes the execution more deterministic
(less moving parts). It's either way racy, which is going to be
addressed in a separate commit.