HPCC-11988 Fix hthor calling helper functions too early

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

HPCC-11988 Fix hthor calling helper functions too early

Reviewed-by: Jake