HPCC-12409 Pathological distribute slowdown fix

Prevent sender queing partial buckets if writers already actively
working on buckets to same target.
Also allow multiple write handler threads to work on the same
target, this allows the serialization/compression (and potentially
dedupping) to occur in parallel even if to same writer.

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
Whilst not the case on all platforms (e.g. windows), our Linux atomic_t is a volatile int.
On that basis, I used it vs volatile qualifier, perhaps that was a mistake.

>In this case you only need to ensure that code that reads the value reads the updated value. I think adding a compiler_memory_barrier() is probably the more correct way of doing that.

I don't know if I care that much if reordered either.. so volatile as far as I understand it would be fine.

But I can imagine some uses of atomic_t (elsewhere) where reordering might cause problems