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

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Will you issue a second pull request for that?