Rework system catalogue prevention access check to use CDB_QueryTables

This change reduces the chances of false positive
(forbidding legit queries). Doesn't solve the problem of false
negative (allowing illegit queries).