HPCC-12446 Prevent a potential deadlock in IRowMultiWriterReader

Also, common up some code in this area.

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
Merge pull request #6556 from jakesmith/hpcc-12446

HPCC-12446 Prevent a potential deadlock in IRowMultiWriterReader

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>