Protect the two passes over the logical replication slots with an LWLock