Revert "Don't check for presence of a PRIMARY KEY if not replicating rows"
This reverts commit
15abe5e5946c1542ecf43b42c69ba03c984d199f as the
initial change was too naïve.
The check shouldn't be within the loop.
It should run after the DDL lock check, since it could change data
in the table in ways that means the incoming DDL might not apply
anymore, e.g. inserting a NULL value into an otherwise NULL-free
table at the same time an
ALTER TABLE ... ALTER COLUMN ... SET NOT NULL
comes in.
It's also necessary for it to be skipped if the node is read-only
so a check like && !node_read_only is needed.