Add missing rwlock calls when access keynode.initial and keynode.managed

    WARNING: ThreadSanitizer: data race
    Write of size 1 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 dns_keynode_trust lib/dns/keytable.c:836
    #1 keyfetch_done lib/dns/zone.c:10187
    #2 dispatch lib/isc/task.c:1152
    #3 run lib/isc/task.c:1344
    #4 <null> <null>

    Previous read of size 1 at 0x000000000001 by thread T2 (mutexes: read M2):
    #0 keynode_dslist_totext lib/dns/keytable.c:682
    #1 dns_keytable_totext lib/dns/keytable.c:732
    #2 named_server_dumpsecroots bin/named/server.c:11357
    #3 named_control_docommand bin/named/control.c:264
    #4 control_command bin/named/controlconf.c:390
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Location is heap block of size 241 at 0x000000000010 allocated by thread T3:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713
    #2 mem_get lib/isc/mem.c:622
    #3 mem_allocateunlocked lib/isc/mem.c:1268
    #4 isc___mem_allocate lib/isc/mem.c:1288
    #5 isc__mem_allocate lib/isc/mem.c:2453
    #6 isc___mem_get lib/isc/mem.c:1037
    #7 isc__mem_get lib/isc/mem.c:2432
    #8 new_keynode lib/dns/keytable.c:346
    #9 insert lib/dns/keytable.c:393
    #10 dns_keytable_add lib/dns/keytable.c:421
    #11 process_key bin/named/server.c:955
    #12 load_view_keys bin/named/server.c:983
    #13 configure_view_dnsseckeys bin/named/server.c:1140
    #14 configure_view bin/named/server.c:5371
    #15 load_configuration bin/named/server.c:9110
    #16 loadconfig bin/named/server.c:10310
    #17 named_server_reconfigcommand bin/named/server.c:10693
    #18 named_control_docommand bin/named/control.c:250
    #19 control_command bin/named/controlconf.c:390
    #20 dispatch lib/isc/task.c:1152
    #21 run lib/isc/task.c:1344
    #22 <null> <null>

    Mutex M1 is already destroyed.

    Mutex M2 is already destroyed.

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T3 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    SUMMARY: ThreadSanitizer: data race lib/dns/keytable.c:836 in dns_keynode_trust
74 jobs for !4205 with 2191-missing-locks-when-accessing-keynode-initial-and-keynode-managed-triggering-tsan in 16 minutes and 28 seconds (queued for 8 seconds)
detached
Status Job ID Name Coverage
  Autoconf
passed #1191997
amd64 linux
autoreconf

00:00:18

 
  Precheck
passed #1191999
amd64 linux
clang-format

00:00:18

passed #1192000
amd64 linux
coccinelle

00:03:10

passed #1192001
amd64 linux
danger

00:00:14

passed #1191998
amd64 linux
misc

00:00:16

passed #1192002
amd64 linux
tarball-create

00:02:09

 
  Build
passed #1192015
amd64 linux
clang:asan

00:02:30

passed #1192019
amd64 linux
clang:buster:amd64

00:01:14

passed #1192022
amd64 libvirt
clang:freebsd11:amd64

00:02:55

passed #1192023
amd64 libvirt
clang:freebsd12:amd64

00:01:07

passed #1192024
amd64 libvirt
clang:openbsd:amd64

00:02:19

passed #1192017
amd64 linux
clang:tsan

00:01:14

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

00:01:10

passed #1192014
amd64 linux
gcc:asan

00:02:29

passed #1192007
amd64 linux
gcc:buster:amd64

00:00:53

passed #1192004
amd64 linux
gcc:centos7:amd64

00:01:05

passed #1192005
amd64 linux
gcc:centos8:amd64

00:01:10

passed #1192013
amd64 linux
gcc:focal:amd64

00:00:55

passed #1192018
amd64 linux
gcc:mutexatomics

00:01:04

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

00:01:07

passed #1192008
amd64 linux
gcc:sid:amd64

00:01:35

passed #1192010
i386 linux
gcc:sid:i386

00:01:20

passed #1192020
amd64 linux
gcc:softhsm2.4

00:01:10

passed #1192021
amd64 linux
gcc:softhsm2.6

00:00:54

passed #1192006
amd64 linux
gcc:stretch:amd64

00:00:55

passed #1192016
amd64 linux
gcc:tsan

00:01:25

passed #1192011
amd64 linux
gcc:tumbleweed:amd64

00:01:19

passed #1192012
amd64 linux
gcc:xenial:amd64

00:01:23

passed #1192025
amd64 windows
msvc:windows:amd64

00:00:45

 
  Unit
passed #1192037
amd64 linux
unit:clang:asan

00:01:22

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

00:01:01

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

00:01:15

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

00:01:22

passed #1192039
amd64 linux
unit:clang:tsan

00:03:02

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

00:01:00

passed #1192036
amd64 linux
unit:gcc:asan

00:01:23

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

00:00:58

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

00:01:04

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

00:01:01

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

00:01:05

passed #1192040
amd64 linux
unit:gcc:mutexatomics

00:01:01

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

00:01:03

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

00:01:02

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

00:00:59

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

00:00:59

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

00:01:00

passed #1192038
amd64 linux
unit:gcc:tsan

00:04:01

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

00:00:57

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

00:01:24

 
  System
passed #1192057
amd64 linux
system:clang:asan

00:12:06

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

00:10:23

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

00:10:09

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

00:10:31

passed #1192059
amd64 linux
system:clang:tsan

00:13:28

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

00:11:50

passed #1192056
amd64 linux
system:gcc:asan

00:12:08

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

00:10:18

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

00:11:07

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

00:11:07

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

00:10:58

passed #1192060
amd64 linux
system:gcc:mutexatomics

00:10:48

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

00:10:59

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

00:11:18

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

00:10:46

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

00:11:41

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

00:10:48

passed #1192058
amd64 linux
system:gcc:tsan

00:14:00

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

00:10:13

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

00:09:45

 
  Docs
passed #1192066
amd64 linux
docs

00:00:50

 
  Postcheck
passed #1192070
amd64 linux
cppcheck

00:00:49

passed #1192067
amd64 linux
flake8

00:00:31

passed #1192068
amd64 linux
pylint

00:00:43

passed #1192069
amd64 linux
scan-build

00:04:41