HPCC-10046 Optimize aggregate on single row datasets

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>