HPCC-12666 Fix regressions in workunit refactoring (HPCC-12250)

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #6714 from ghalliday/issue12666

HPCC-12666 Fix regressions in workunit refactoring (HPCC-12250)

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>