HPCC-9478 - Nested global loop crash

Nested global loop crashed on 2nd iteration, because the internal
result set (for loop counter, input and output streams) wasn't
being reinitialized.

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

HPCC-9478 - Nested global loop crash

Reviewed-By: Gavin Halliday <gavin.halliday@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>