HPCC-9523 - Fix potential hashdedup deadlock

If rehashing allocates, can cause memory callback to spill the
hash table involved and deadlock.
Be careful when allocating in a mutex.

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