HPCC-10348 Fix DISTRIBUTED() so it preserves existing grouping/sort order

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