HPCC-9743 Speed up #APPEND and #LOOP processing

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