Add tracing to socket thread.
Fix lockup on accepted socket disconnect.