HPCC-8909 - Avoid thor recycling if registration error detected

Serialize an error code to master and exit thor cleanly
on registration error to avoid scripts causing auto-recycle

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
Correct return type
Merge pull request #4133 from jakesmith/thorreg-abort

HPCC-8909 - Avoid thor recycling if registration error detected

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>