HPCC-10899 - Fix spilt results records getting lost

If a LOOP or GRAPH result, spilt after it had started to be read,
rows were lost.
Also, improve efficiency of spill write callback mechanism.

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

HPCC-10899 - Fix spilt results records getting lost

Reviewed-By: Gavin Halliday <gavin.halliday@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>