move remove_global_thread() out of the lock
move remove_global_thread() out of the lock

since it locks the same mutex, causing deadlock

DeNA/HandlerSocket-Plugin-for-MySQL,DeNA/HandlerSocket-Plugin-for-MySQL,DeNA/HandlerSocket-Plugin-for-MySQL,DeNA/HandlerSocket-Plugin-for-MySQL