Hold qid->lock when calling deref_portentry() as

socket_search() need portentry to be unchanging.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 deref_portentry lib/dns/dispatch.c:630
    #1 deactivate_dispsocket lib/dns/dispatch.c:861
    #2 udp_recv lib/dns/dispatch.c:1105
    #3 udp_exrecv lib/dns/dispatch.c:1028
    #4 dispatch lib/isc/task.c:1152
    #5 run lib/isc/task.c:1344
    #6 <null> <null>

    Previous read of size 8 at 0x000000000001 by thread T2 (mutexes: write M1, write M2):
    #0 socket_search lib/dns/dispatch.c:661
    #1 get_dispsocket lib/dns/dispatch.c:744
    #2 dns_dispatch_addresponse lib/dns/dispatch.c:3120
    #3 resquery_send lib/dns/resolver.c:2467
    #4 fctx_query lib/dns/resolver.c:2217
    #5 fctx_try lib/dns/resolver.c:4245
    #6 fctx_timeout lib/dns/resolver.c:4570
    #7 dispatch lib/isc/task.c:1152
    #8 run lib/isc/task.c:1344
    #9 <null> <null>

(cherry picked from commit 5c253c41)
82 jobs for !4303 with 2226-tsan-error-in-dispatch-c-v9_11 in 14 minutes and 55 seconds (queued for 20 seconds)
detached
Status Job ID Name Coverage
  Precheck
passed #1246423
amd64 linux
autoreconf

00:00:15

passed #1246425
amd64 linux
clang-format

00:00:08

passed #1246426
amd64 linux
coccinelle

00:01:01

passed #1246427
amd64 linux
danger

00:00:14

passed #1246424
amd64 linux
misc

00:00:13

 
  Build
passed #1246442
amd64 linux
clang:asan

00:04:30

passed #1246447
amd64 linux
clang:buster:amd64

00:02:04

passed #1246449
amd64 libvirt
clang:freebsd11:amd64

00:02:05

passed #1246450
amd64 libvirt
clang:freebsd12:amd64

00:01:56

passed #1246451
amd64 libvirt
clang:openbsd:amd64

00:04:01

passed #1246444
amd64 linux
clang:tsan

00:02:26

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

00:01:44

passed #1246441
amd64 linux
gcc:asan

00:03:21

passed #1246433
amd64 linux
gcc:buster:amd64

00:01:44

passed #1246429
amd64 linux
gcc:centos6:amd64

00:01:24

passed #1246430
amd64 linux
gcc:centos7:amd64

00:01:28

passed #1246431
amd64 linux
gcc:centos8:amd64

00:01:40

passed #1246438
amd64 linux
gcc:fedora32:amd64

00:01:34

passed #1246440
amd64 linux
gcc:focal:amd64

00:01:46

passed #1246445
amd64 linux
gcc:mutexatomics

00:01:40

passed #1246446
amd64 linux
gcc:noatomics

00:01:50

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

00:01:38

passed #1246448
amd64 linux
gcc:pkcs11

00:01:30

passed #1246434
amd64 linux
gcc:sid:amd64

00:02:12

passed #1246436
i386 linux
gcc:sid:i386

00:01:35

passed #1246432
amd64 linux
gcc:stretch:amd64

00:01:59

passed #1246443
amd64 linux
gcc:tsan

00:01:53

passed #1246437
amd64 linux
gcc:tumbleweed:amd64

00:01:48

passed #1246439
amd64 linux
gcc:xenial:amd64

00:01:48

passed #1246453
amd64 windows
msvc:windows:amd64

00:02:22

passed #1246452
amd64 linux
nolibtool:sid:amd64

00:02:29

 
  Unit
passed #1246467
amd64 linux
unit:clang:asan

00:01:12

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

00:00:31

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

00:01:09

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

00:00:56

passed #1246469
amd64 linux
unit:clang:tsan

00:03:58

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

00:00:37

passed #1246466
amd64 linux
unit:gcc:asan

00:01:13

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

00:00:34

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

00:00:39

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

00:00:35

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

00:00:38

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

00:00:36

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

00:00:37

passed #1246470
amd64 linux
unit:gcc:mutexatomics

00:00:35

passed #1246471
amd64 linux
unit:gcc:noatomics

00:00:34

passed #1246473
amd64 linux
unit:gcc:pkcs11

00:00:36

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

00:00:31

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

00:00:34

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

00:00:37

passed #1246468
amd64 linux
unit:gcc:tsan

00:04:56

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

00:00:33

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

00:00:34

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

00:00:51

 
  System
passed #1246490
amd64 linux
system:clang:asan

00:08:58

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

00:07:18

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

00:08:07

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

00:08:10

passed #1246492
amd64 linux
system:clang:tsan

00:11:13

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

00:07:36

passed #1246489
amd64 linux
system:gcc:asan

00:09:20

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

00:07:24

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

00:07:21

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

00:07:17

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

00:07:20

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

00:07:08

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

00:07:43

passed #1246493
amd64 linux
system:gcc:mutexatomics

00:07:08

passed #1246494
amd64 linux
system:gcc:noatomics

00:07:29

passed #1246496
amd64 linux
system:gcc:pkcs11

00:08:00

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

00:07:22

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

00:07:36

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

00:07:20

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

00:12:29

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

00:07:13

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

00:06:45

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

00:07:19

 
  Docs
passed #1246500
amd64 linux
docs

00:00:28

 
  Postcheck
passed #1246504
amd64 linux
cppcheck

00:00:25

passed #1246501
amd64 linux
flake8

00:00:21

passed #1246502
amd64 linux
pylint

00:00:22

passed #1246503
amd64 linux
scan-build

00:09:15

 
Name Stage Failure
failed
system:gcc:tsan System
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 1393 files

Uploading artifacts as "archive" to coordinator... ok
id=1246491 responseStatus=201 Created token=PpN7gm1z
Cleaning up file based variables
ERROR: Job failed: exit code 1