Break lock order loop by sending TAT in an event

The dotat() function has been changed to send the TAT
query asynchronously, so there's no lock order loop
because we initialize the data first and then we schedule
the TAT send to happen asynchronously.

This breaks following lock-order loops:

zone->lock (dns_zone_setviewcommit) while holding view->lock
(dns_view_setviewcommit)

keytable->lock (dns_keytable_find) while holding zone->lock
(zone_asyncload)

view->lock (dns_view_findzonecut) while holding keytable->lock
(dns_keytable_forall)

(cherry picked from commit 3c4b68af)
80 jobs for !4166 with 2156-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_mutex_lock-2-v9_11 in 15 minutes and 2 seconds (queued for 12 seconds)
latest detached
Status Job ID Name Coverage
  Precheck
passed #1174729
amd64 linux
autoreconf

00:00:16

passed #1174731
amd64 linux
clang-format

00:00:09

passed #1174732
amd64 linux
coccinelle

00:01:02

passed #1174808
linux amd64
danger

00:00:12

passed #1174730
amd64 linux
misc

00:00:21

failed #1174733
amd64 linux
danger

00:00:14

 
  Build
passed #1174748
amd64 linux
clang:asan

00:04:42

passed #1174752
amd64 linux
clang:buster:amd64

00:01:57

passed #1174754
amd64 libvirt
clang:freebsd11:amd64

00:02:05

passed #1174755
amd64 libvirt
clang:freebsd12:amd64

00:01:55

passed #1174756
amd64 libvirt
clang:openbsd:amd64

00:04:18

passed #1174750
amd64 linux
clang:tsan

00:02:30

passed #1174734
amd64 linux
gcc:alpine3.12:amd64

00:01:48

passed #1174747
amd64 linux
gcc:asan

00:03:36

passed #1174739
amd64 linux
gcc:buster:amd64

00:01:45

passed #1174735
amd64 linux
gcc:centos6:amd64

00:01:24

passed #1174736
amd64 linux
gcc:centos7:amd64

00:01:45

passed #1174737
amd64 linux
gcc:centos8:amd64

00:01:41

passed #1174744
amd64 linux
gcc:fedora32:amd64

00:01:52

passed #1174746
amd64 linux
gcc:focal:amd64

00:01:57

passed #1174751
amd64 linux
gcc:mutexatomics

00:01:53

passed #1174741
amd64 linux
gcc:out-of-tree

00:01:49

passed #1174753
amd64 linux
gcc:pkcs11

00:01:51

passed #1174740
amd64 linux
gcc:sid:amd64

00:02:25

passed #1174742
i386 linux
gcc:sid:i386

00:01:57

passed #1174738
amd64 linux
gcc:stretch:amd64

00:02:12

passed #1174749
amd64 linux
gcc:tsan

00:02:13

passed #1174743
amd64 linux
gcc:tumbleweed:amd64

00:01:41

passed #1174745
amd64 linux
gcc:xenial:amd64

00:02:02

passed #1174758
amd64 windows
msvc:windows:amd64

00:01:10

passed #1174757
amd64 linux
nolibtool:sid:amd64

00:02:29

 
  Unit
passed #1174772
amd64 linux
unit:clang:asan

00:01:11

passed #1174776
amd64 linux
unit:clang:buster:amd64

00:00:32

passed #1174778
amd64 libvirt
unit:clang:freebsd11:amd64

00:01:07

passed #1174779
amd64 libvirt
unit:clang:freebsd12:amd64

00:00:56

passed #1174774
amd64 linux
unit:clang:tsan

00:04:20

passed #1174759
amd64 linux
unit:gcc:alpine3.12:amd64

00:00:33

passed #1174771
amd64 linux
unit:gcc:asan

00:01:10

passed #1174764
amd64 linux
unit:gcc:buster:amd64

00:00:36

passed #1174760
amd64 linux
unit:gcc:centos6:amd64

00:00:38

passed #1174761
amd64 linux
unit:gcc:centos7:amd64

00:00:35

passed #1174762
amd64 linux
unit:gcc:centos8:amd64

00:00:35

passed #1174768
amd64 linux
unit:gcc:fedora32:amd64

00:00:34

passed #1174770
amd64 linux
unit:gcc:focal:amd64

00:00:34

passed #1174775
amd64 linux
unit:gcc:mutexatomics

00:00:35

passed #1174777
amd64 linux
unit:gcc:pkcs11

00:00:37

passed #1174765
amd64 linux
unit:gcc:sid:amd64

00:00:29

passed #1174766
i386 linux
unit:gcc:sid:i386

00:00:31

passed #1174763
amd64 linux
unit:gcc:stretch:amd64

00:00:30

passed #1174773
amd64 linux
unit:gcc:tsan

00:04:57

passed #1174767
amd64 linux
unit:gcc:tumbleweed:amd64

00:00:32

passed #1174769
amd64 linux
unit:gcc:xenial:amd64

00:00:33

passed #1174780
amd64 linux
unit:nolibtool:sid:amd64

00:00:45

 
  System
passed #1174794
amd64 linux
system:clang:asan

00:08:57

passed #1174798
amd64 linux
system:clang:buster:amd64

00:07:07

passed #1174800
amd64 libvirt
system:clang:freebsd11:amd64

00:08:01

passed #1174801
amd64 libvirt
system:clang:freebsd12:amd64

00:08:10

passed #1174796
amd64 linux
system:clang:tsan

00:11:00

passed #1174781
amd64 linux
system:gcc:alpine3.12:amd64

00:07:31

passed #1174793
amd64 linux
system:gcc:asan

00:09:20

passed #1174786
amd64 linux
system:gcc:buster:amd64

00:07:25

passed #1174782
amd64 linux
system:gcc:centos6:amd64

00:07:20

passed #1174783
amd64 linux
system:gcc:centos7:amd64

00:07:32

passed #1174784
amd64 linux
system:gcc:centos8:amd64

00:07:23

passed #1174790
amd64 linux
system:gcc:fedora32:amd64

00:07:14

passed #1174792
amd64 linux
system:gcc:focal:amd64

00:07:00

passed #1174797
amd64 linux
system:gcc:mutexatomics

00:07:19

passed #1174799
amd64 linux
system:gcc:pkcs11

00:08:06

passed #1174787
amd64 linux
system:gcc:sid:amd64

00:07:01

passed #1174788
i386 linux
system:gcc:sid:i386

00:07:28

passed #1174785
amd64 linux
system:gcc:stretch:amd64

00:07:19

passed #1174795
amd64 linux
system:gcc:tsan

00:12:18

passed #1174789
amd64 linux
system:gcc:tumbleweed:amd64

00:07:07

passed #1174791
amd64 linux
system:gcc:xenial:amd64

00:06:48

passed #1174802
amd64 linux
system:nolibtool:sid:amd64

00:07:13

 
  Docs
passed #1174803
amd64 linux
docs

00:00:27

 
  Postcheck
passed #1174807
amd64 linux
cppcheck

00:00:25

passed #1174804
amd64 linux
flake8

00:00:21

passed #1174805
amd64 linux
pylint

00:00:25

passed #1174806
amd64 linux
scan-build

00:09:08