properly close ssl-stream-socket even if it is raw file descriptor