Backport https://github.com/rsyslog/librelp/pull/292
Move relpTcpDestructTLS() before the socket close so SSL_shutdown()
can send the close_notify on a valid fd. Change BIO_new_socket()
from BIO_CLOSE to BIO_NOCLOSE so SSL_free() does not close the fd
a second time via the BIO destructor. Add conn = NULL after
SSL_set_bio() to prevent the error-path use-after-free.
Resolves: RHEL-192630
Signed-off-by: Cropi <alakatos@redhat.com>