The zt_destroy() function was missing isc_refcount_destroy() on the two
reference counters. The isc_refcount_destroy() adds proper memory
ordering on destroy and also ensures that the reference counters have
been zeroed before destroying the object.
static void
zt_destroy(dns_zt_t *zt) {
+ isc_refcount_destroy(&zt->references);
+ isc_refcount_destroy(&zt->loads_pending);
+
if (atomic_load_acquire(&zt->flush)) {
(void)dns_zt_apply(zt, false, NULL, flush, NULL);
}