HPCC-11937 Fix race condition in smart join

HPCC-11953 Throw error when RIGHT rows would be lost

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
It is much more efficient to lock the array once, than to lock it for each array access - which the caller needed to do to fix one of the problems.
(The reason you might need to lock before the call is if another thread could change the index of the rows in the table - e.g., when compacting, so the lock needs to cover the index calculation as well).  My comment about indexes may not be accurate - on reflection they might not be able to change in the current use cases - but I still think it is better to require the caller to lock.  

I don't understand the comment about inline.