HPCC-9253 Significant semaphore overhead in the unordered concat

Fix regressions from previous commit, related to ingorrect output grouping,
and potential lockups.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>