caos.backends.pgsql.transformer: Check for node visiblity when linking subqueries
caos.backends.pgsql.transformer: Check for node visiblity when linking subqueries

Entity nodes are now more stringently bound to each other, so subquery
consolidation will touch nodes it previously didn't.  Make sure that all
referred nodes are properly visible on the corresponding query level.

edgedb/edgedb,edgedb/edgedb,edgedb/edgedb