ERT-803: Using threaded server - fixed locking.

The first implementation of the threaded server created the lock in the
running thread, i.e. each thread got it's own private lock.