tls_gnutls: fix hang on disconnection