HPCC-12158 Check ptree pointer before use in addClusterQueryStates

Signed-off-by: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
Merge pull request #6394 from afishbeck/multiQuerySetCore

HPCC-12158 Check ptree pointer before use in addClusterQueryStates

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>