Avoid race condition on socket being sent to select while close by disconnecting in the same thread where an exception occured.
Also print backtrace when PANICing.
Merge branch 'more-socket-fun'