HPCC-11077 - Avoid RHS sort if isRightAlreadySorted

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
Merge pull request #5578 from jakesmith/hpcc-11077

HPCC-11077 - Avoid RHS sort if isRightAlreadySorted

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>