Fix connection crash when trying to set TCP/SSL socket `active_n` option.
Prior to this fix, if a socket is already closed when connection process tries to set `active_n` option, it causes a `case_clause` crash.