HPCC-12409 A little more refactoring

Move a bit more into CTarget
Spotted a couple of pontentially thread-unsafe uses of counters/
flags.

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>