HPCC-9333 - Fix possible lost of records in sort

If close to being out of memory, a spilling callback could occur
just as the sort is finishing and preparing it's spill streams.
If that happened, it could lose the last spilt chunk of records

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

HPCC-9333 - Fix possible lost of records in sort

Reviewed-By: Gavin Halliday <gavin.halliday@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Community Edition 3.10.8-4 Gold

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Merge remote-tracking branch 'origin/candidate-3.10.8' into candidate-3.10.x

Conflicts:
	version.cmake

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Merge remote-tracking branch 'origin/candidate-3.10.x' into candidate-4.0.0

Conflicts:
	thorlcr/thorutil/thmem.cpp

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>