HPCC-11940 Avoid multiple control:queries calls for same queryset

The code is backported from: https://github.com/hpcc-systems/
HPCC-Platform/pull/6158.

To get query status, the existing code does control:queries call
for each query. It takes a long time for WUListQueries. This
fix collects unique QuerySetIDs for all of the queries and calls
the control:queries for each unique QuerySetID. Then, set query
status for the queries which belong to the QuerySet.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>