In fctx_query(), resquery_ref(query) is called before
dns_dispatch_connect() in anticipation of the resquery_connected()
callback consuming the reference. When dns_dispatch_connect() fails
synchronously on TCP (e.g. from dns_transport_get_tlsctx() failing
in tcp_dispatch_connect()), the connect callback is never scheduled,
so the extra reference is never consumed. This has been fixed.
Backport of MR !11640
Merge branch 'backport-ondrej/fix-resquery-refcount-9.20' into 'bind-9.20'
See merge request isc-projects/bind9!11656