Guard against a running replication

By locking we can prevent that an already running replication is overwritten.