HPCC-11734 Fix efficiency issues with CQuerySetQueriesPager

1) In CQuerySetQueriesPager::getElements(), change the unlocked
connection to /QuerySets to read lock connection. 2) Revise the
getElements() to avoid re-connect to /QuerySets. 3) Revise the
getQueryRegistry() to not double lock the /QuerySets. 4) Revise
getQueryRegistryRoot() to not lock to /QuerySets twice. 5) Only
lock the /QuerySets/QuerySet if a QuerySet ID is specified. At
this time, not many things can be done for server-side matching
because the parent properties of a query node are not reachable
(no 'up' axis support). For example, the parent property Alias
is used to set query's property @activated.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
Also, there's a race condition now, if the initial connection test fails (QuerySet[@id..] is not there, then between that test and the globalLock another thread could create it.
Which would mean >=2 threads could queue up on globalLock and both add the same QuerySet[@id..]

On write you'll have to establish the globalLock, then re-check the QuerySet[@id..] doesn't exist, then (to preserve the previous semantics of lock to QuerySet[@id..] only, create a new node.
You can use RTM_CREATE_ADD at that point.