LP#
1774703 Limit scope of thread locks
Avoid thread contention issues when running this websockets code:
https://github.com/jchampio/apache-websocket
In general, the scope of the thread locking has been dimished, focused
more closely on keeping blocks of reads/writes to the shared recipient
cache running in a single thread at a time.
Thread locks have also been fully removed from the idle timeout thread.
By the time it modifies any shared data, the process is already shutting
down.
Added a few thread safety checks to avoid (the already unlikely and
maybe not even a problem) multiple translator->close() calls just to be
extra safe.
Signed-off-by: Bill Erickson <berickxx@gmail.com>