Resolve two issues seen at P1 in MT mode.
- Multiple slots could access the thread-hash -> thread-counter map concurrently. The mutex protection was only per-slot. Resolved by adding a small global lock to this map lookup.
- We encountered hash collisions online. As we only collect monitoring data here, this is not too critical and the exception can be caught and discarded with only a
DEBUG
message. A unit test was added around this.