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)
79 jobs for !4165 with 2156-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_mutex_lock-2-v9_16 in 16 minutes and 59 seconds (queued for 10 seconds)
latest detached
Status Job ID Name Coverage
  Precheck
passed #1174649
amd64 linux
autoreconf

00:00:15

passed #1174651
amd64 linux
clang-format

00:00:16

passed #1174652
amd64 linux
coccinelle

00:03:23

passed #1174653
amd64 linux
danger

00:00:13

passed #1174650
amd64 linux
misc

00:00:12

 
  Build
passed #1174667
amd64 linux
clang:asan

00:03:48

passed #1174671
amd64 linux
clang:buster:amd64

00:02:00

passed #1174674
amd64 libvirt
clang:freebsd11:amd64

00:02:02

passed #1174675
amd64 libvirt
clang:freebsd12:amd64

00:01:55

passed #1174676
amd64 libvirt
clang:openbsd:amd64

00:04:04

passed #1174669
amd64 linux
clang:tsan

00:02:03

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

00:01:48

passed #1174666
amd64 linux
gcc:asan

00:03:06

passed #1174659
amd64 linux
gcc:buster:amd64

00:01:42

passed #1174655
amd64 linux
gcc:centos6:amd64

00:01:21

passed #1174656
amd64 linux
gcc:centos7:amd64

00:01:39

passed #1174657
amd64 linux
gcc:centos8:amd64

00:01:47

passed #1174665
amd64 linux
gcc:focal:amd64

00:01:26

passed #1174670
amd64 linux
gcc:mutexatomics

00:01:35

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

00:01:31

passed #1174660
amd64 linux
gcc:sid:amd64

00:02:17

passed #1174662
i386 linux
gcc:sid:i386

00:01:46

passed #1174672
amd64 linux
gcc:softhsm2.4

00:01:43

passed #1174673
amd64 linux
gcc:softhsm2.6

00:01:37

passed #1174658
amd64 linux
gcc:stretch:amd64

00:01:58

passed #1174668
amd64 linux
gcc:tsan

00:02:01

passed #1174663
amd64 linux
gcc:tumbleweed:amd64

00:01:41

passed #1174664
amd64 linux
gcc:xenial:amd64

00:01:39

passed #1174678
amd64 windows
msvc:windows:amd64

00:00:56

passed #1174677
amd64 linux
nolibtool:sid:amd64

00:02:22

 
  Unit
passed #1174691
amd64 linux
unit:clang:asan

00:00:52

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

00:00:39

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

00:01:05

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

00:00:58

passed #1174693
amd64 linux
unit:clang:tsan

00:01:31

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

00:00:47

passed #1174690
amd64 linux
unit:gcc:asan

00:00:51

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

00:00:37

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

00:00:37

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

00:00:38

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

00:00:36

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

00:00:38

passed #1174694
amd64 linux
unit:gcc:mutexatomics

00:00:37

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

00:00:36

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

00:00:48

passed #1174696
amd64 linux
unit:gcc:softhsm2.4

00:00:36

passed #1174697
amd64 linux
unit:gcc:softhsm2.6

00:00:37

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

00:00:38

passed #1174692
amd64 linux
unit:gcc:tsan

00:02:02

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

00:00:36

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

00:00:36

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

00:00:49

 
  System
passed #1174713
amd64 linux
system:clang:asan

00:11:38

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

00:10:09

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

00:10:25

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

00:09:56

failed #1174715
amd64 linux allowed to fail
system:clang:tsan

00:13:59

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

00:11:41

passed #1174712
amd64 linux
system:gcc:asan

00:11:58

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

00:11:00

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

00:11:00

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

00:11:05

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

00:10:48

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

00:10:35

passed #1174716
amd64 linux
system:gcc:mutexatomics

00:10:11

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

00:10:25

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

00:10:06

passed #1174718
amd64 linux
system:gcc:softhsm2.4

00:10:09

passed #1174719
amd64 linux
system:gcc:softhsm2.6

00:10:45

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

00:10:19

failed #1174714
amd64 linux allowed to fail
system:gcc:tsan

00:14:17

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

00:10:53

failed #1174710
amd64 linux
system:gcc:xenial:amd64

00:10:53

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

00:11:21

 
  Docs
passed #1174723
amd64 linux
docs

00:02:03

 
  Postcheck
passed #1174727
amd64 linux
cppcheck

00:00:19

passed #1174724
amd64 linux
flake8

00:00:18

passed #1174725
amd64 linux
pylint

00:00:22

passed #1174726
amd64 linux
scan-build

00:08:19

 
Name Stage Failure
failed
system:gcc:xenial:amd64 System
I:Core dumps were found for the following system tests:
I: zero
Makefile:489: recipe for target 'test' failed
make: *** [test] Error 1
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 1536 files

Uploading artifacts as "archive" to coordinator... ok
id=1174710 responseStatus=201 Created token=GXBys8Lo
ERROR: Job failed: exit code 1
failed
system:gcc:tsan System
make: *** [Makefile:491: test] Error 1
Running after_script
Running after script...
$ find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 9731 files

Uploading artifacts as "archive" to coordinator... ok
id=1174714 responseStatus=201 Created token=CK1GYWnX
ERROR: Job failed: exit code 1
failed
system:clang:tsan System
make: *** [Makefile:491: test] Error 1
Running after_script
Running after script...
$ find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 9392 files

Uploading artifacts as "archive" to coordinator... ok
id=1174715 responseStatus=201 Created token=JVxgtTqu
ERROR: Job failed: exit code 1