Make 'client' local to the new thread
Actually use mutex to sync access to @clients
Use mutex to sync access to @socket