HPCC-10364 Generate mergeAggregate() for hash aggregate if input is grouped.

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge branch 'issue10364' into closedown-4.2.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>