Address TSAN error between dns_rbt_findnode() and subtractrdataset().

Having dns_rbt_findnode() in previous_closest_nsec() check of
node->data is a optimisation that triggers a TSAN error with
subtractrdataset().  find_closest_nsec() still needs to check if
the NSEC record are active or not and look for a earlier NSEC records
if it isn't.  Set DNS_RBTFIND_EMPTYDATA so node->data isn't referenced
without the node lock being held.

    WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1 (mutexes: read M1, read M2):
    #0 dns_rbt_findnode lib/dns/rbt.c:1708
    #1 previous_closest_nsec lib/dns/rbtdb.c:3760
    #2 find_closest_nsec lib/dns/rbtdb.c:3942
    #3 zone_find lib/dns/rbtdb.c:4091
    #4 dns_db_findext lib/dns/db.c:536
    #5 query_lookup lib/ns/query.c:5582
    #6 ns__query_start lib/ns/query.c:5505
    #7 query_setup lib/ns/query.c:5229
    #8 ns_query_start lib/ns/query.c:11380
    #9 ns__client_request lib/ns/client.c:2166
    #10 processbuffer netmgr/tcpdns.c:230
    #11 dnslisten_readcb netmgr/tcpdns.c:309
    #12 read_cb netmgr/tcp.c:832
    #13 <null> <null>
    #14 <null> <null>

    Previous write of size 8 at 0x000000000001 by thread T2 (mutexes: write M3):
    #0 subtractrdataset lib/dns/rbtdb.c:7133
    #1 dns_db_subtractrdataset lib/dns/db.c:742
    #2 diff_apply lib/dns/diff.c:368
    #3 dns_diff_apply lib/dns/diff.c:459
    #4 do_one_tuple lib/dns/update.c:247
    #5 update_one_rr lib/dns/update.c:275
    #6 delete_if_action lib/dns/update.c:689
    #7 foreach_rr lib/dns/update.c:471
    #8 delete_if lib/dns/update.c:716
    #9 dns_update_signaturesinc lib/dns/update.c:1948
    #10 receive_secure_serial lib/dns/zone.c:15637
    #11 dispatch lib/isc/task.c:1152
    #12 run lib/isc/task.c:1344
    #13 <null> <null>

    Location is heap block of size 130 at 0x000000000028 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 create_node lib/dns/rbt.c:2239
    #9 dns_rbt_addnode lib/dns/rbt.c:1202
    #10 dns_rbtdb_create lib/dns/rbtdb.c:8668
    #11 dns_db_create lib/dns/db.c:118
    #12 receive_secure_db lib/dns/zone.c:16154
    #13 dispatch lib/isc/task.c:1152
    #14 run lib/isc/task.c:1344
    #15 <null> <null>

    Mutex M1 (0x000000000040) created at:
    #0 pthread_rwlock_init <null>
    #1 isc_rwlock_init lib/isc/rwlock.c:39
    #2 dns_rbtdb_create lib/dns/rbtdb.c:8527
    #3 dns_db_create lib/dns/db.c:118
    #4 receive_secure_db lib/dns/zone.c:16154
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Mutex M2 (0x000000000044) created at:
    #0 pthread_rwlock_init <null>
    #1 isc_rwlock_init lib/isc/rwlock.c:39
    #2 dns_rbtdb_create lib/dns/rbtdb.c:8600
    #3 dns_db_create lib/dns/db.c:118
    #4 receive_secure_db lib/dns/zone.c:16154
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Mutex M3 (0x000000000046) created at:
    #0 pthread_rwlock_init <null>
    #1 isc_rwlock_init lib/isc/rwlock.c:39
    #2 dns_rbtdb_create lib/dns/rbtdb.c:8600
    #3 dns_db_create lib/dns/db.c:118
    #4 receive_secure_db lib/dns/zone.c:16154
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_nm_start netmgr/netmgr.c:232
    #3 create_managers bin/named/main.c:909
    #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/rbt.c:1708 in dns_rbt_findnode

(cherry picked from commit 244f84a8)
84 jobs for !4385 with 2211-tsan-error-previous_closest_nsec-dns_rbt_findnode-vs-subtractrdataset-v9_11 in 67 minutes and 7 seconds (queued for 14 seconds)
detached
Status Job ID Name Coverage
  Precheck
passed #1289455
amd64 linux
autoreconf

00:00:17

passed #1289457
amd64 linux
clang-format

00:00:09

passed #1289458
amd64 linux
coccinelle

00:01:00

passed #1289538
linux amd64
danger

00:00:15

passed #1289456
amd64 linux
misc

00:00:14

failed #1289459
amd64 linux
danger

00:00:13

 
  Build
passed #1289474
amd64 linux
clang:asan

00:04:22

passed #1289479
amd64 linux
clang:buster:amd64

00:01:56

passed #1289481
amd64 libvirt
clang:freebsd11:amd64

00:01:53

passed #1289482
amd64 libvirt
clang:freebsd12:amd64

00:01:50

passed #1289483
amd64 libvirt
clang:openbsd:amd64

00:04:02

passed #1289476
amd64 linux
clang:tsan

00:02:18

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

00:01:40

passed #1289473
amd64 linux
gcc:asan

00:03:23

passed #1289465
amd64 linux
gcc:buster:amd64

00:01:29

passed #1289461
amd64 linux
gcc:centos6:amd64

00:01:20

passed #1289462
amd64 linux
gcc:centos7:amd64

00:01:25

passed #1289463
amd64 linux
gcc:centos8:amd64

00:01:33

passed #1289470
amd64 linux
gcc:fedora33:amd64

00:01:33

passed #1289472
amd64 linux
gcc:focal:amd64

00:01:42

passed #1289477
amd64 linux
gcc:mutexatomics

00:01:40

passed #1289478
amd64 linux
gcc:noatomics

00:01:53

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

00:01:33

passed #1289480
amd64 linux
gcc:pkcs11

00:01:38

passed #1289466
amd64 linux
gcc:sid:amd64

00:02:24

passed #1289468
i386 linux
gcc:sid:i386

00:01:45

passed #1289464
amd64 linux
gcc:stretch:amd64

00:01:53

passed #1289475
amd64 linux
gcc:tsan

00:01:55

passed #1289469
amd64 linux
gcc:tumbleweed:amd64

00:01:39

passed #1289471
amd64 linux
gcc:xenial:amd64

00:01:47

passed #1289485
amd64 windows
msvc:windows:amd64

00:01:12

passed #1289484
amd64 linux
nolibtool:sid:amd64

00:02:19

 
  Unit
passed #1289499
amd64 linux
unit:clang:asan

00:02:05

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

00:00:53

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

00:01:24

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

00:01:22

passed #1289501
amd64 linux
unit:clang:tsan

00:04:47

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

00:00:59

passed #1289498
amd64 linux
unit:gcc:asan

00:01:40

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

00:01:13

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

00:01:00

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

00:00:59

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

00:00:54

passed #1289495
amd64 linux
unit:gcc:fedora33:amd64

00:01:01

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

00:01:03

passed #1289502
amd64 linux
unit:gcc:mutexatomics

00:00:37

passed #1289503
amd64 linux
unit:gcc:noatomics

00:00:55

passed #1289505
amd64 linux
unit:gcc:pkcs11

00:00:57

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

00:01:13

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

00:00:53

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

00:00:55

passed #1289500
amd64 linux
unit:gcc:tsan

00:05:11

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

00:00:54

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

00:00:57

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

00:02:05

 
  System
passed #1289522
amd64 linux
system:clang:asan

00:09:23

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

00:07:44

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

00:08:43

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

00:08:38

passed #1289524
amd64 linux
system:clang:tsan

00:12:00

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

00:07:37

passed #1289521
amd64 linux
system:gcc:asan

00:09:52

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

00:08:15

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

00:07:48

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

00:07:51

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

00:07:54

failed #1289518
amd64 linux
system:gcc:fedora33:amd64

01:00:01

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

00:07:34

passed #1289525
amd64 linux
system:gcc:mutexatomics

00:07:22

passed #1289526
amd64 linux
system:gcc:noatomics

00:07:31

passed #1289528
amd64 linux
system:gcc:pkcs11

00:08:14

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

00:08:02

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

00:07:01

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

00:07:46

passed #1289523
amd64 linux
system:gcc:tsan

00:12:29

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

00:07:27

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

00:07:27

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

00:09:06

 
  Docs
passed #1289532
amd64 linux
docs

00:00:28

 
  Postcheck
passed #1289536
amd64 linux
cppcheck

00:00:25

passed #1289533
amd64 linux
flake8

00:00:20

passed #1289537
amd64 linux
gcov

00:01:10

74.0%
passed #1289534
amd64 linux
pylint

00:00:25

passed #1289535
amd64 linux
scan-build

00:08:25

 
Name Stage Failure
failed
system:gcc:fedora33:amd64 System The script exceeded the maximum execution time set for the job
I:zero:successfully completed pass 6 of 10
I:zero:successfully completed pass 7 of 10
I:zero:successfully completed pass 8 of 10
I:zero:successfully completed pass 9 of 10
I:zero:successfully completed pass 10 of 10
I:zero:exit status: 0
R:zero:PASS
E:zero:Tue Nov 10 21:43:06 UTC 2020
ERROR: Job failed: execution took longer than 1h0m0s seconds