Add thread_signal back its used by signal handler.
Add SOCK_FLAG_SSL if the socket should be SSL prevent insecure read/write.
Try handle the socket in shutdown_ssl error for SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE