Complete the isc_nmhandle_detach() in the worker thread.

isc_nmhandle_detach() needs to complete in the same thread
as shutdown_walk_cb() to avoid a race.  Clear the caller's
pointer then pass control to the worker if necessary.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1:
    #0 isc_nmhandle_detach lib/isc/netmgr/netmgr.c:1258:15
    #1 control_command bin/named/controlconf.c:388:3
    #2 dispatch lib/isc/task.c:1152:7
    #3 run lib/isc/task.c:1344:2

    Previous read of size 8 at 0x000000000001 by thread T2:
    #0 isc_nm_pauseread lib/isc/netmgr/netmgr.c:1449:33
    #1 recv_data lib/isccc/ccmsg.c:109:2
    #2 isc__nm_tcp_shutdown lib/isc/netmgr/tcp.c:1157:4
    #3 shutdown_walk_cb lib/isc/netmgr/netmgr.c:1515:3
    #4 uv_walk <null>
    #5 process_queue lib/isc/netmgr/netmgr.c:659:4
    #6 process_normal_queue lib/isc/netmgr/netmgr.c:582:10
    #7 process_queues lib/isc/netmgr/netmgr.c:590:8
    #8 async_cb lib/isc/netmgr/netmgr.c:548:2
    #9 <null> <null>

(cherry picked from commit f95ba8aa)
79 jobs for !4262 with 2209-tsan-error-bin-named-controlconf-c-related-v9_16 in 17 minutes and 41 seconds (queued for 8 seconds)
detached
Status Job ID Name Coverage
  Precheck
passed #1222158
amd64 linux
autoreconf

00:00:17

passed #1222160
amd64 linux
clang-format

00:00:18

passed #1222161
amd64 linux
coccinelle

00:03:37

passed #1222162
amd64 linux
danger

00:00:16

passed #1222159
amd64 linux
misc

00:00:15

 
  Build
passed #1222176
amd64 linux
clang:asan

00:04:13

passed #1222180
amd64 linux
clang:buster:amd64

00:01:54

passed #1222183
amd64 libvirt
clang:freebsd11:amd64

00:02:00

passed #1222184
amd64 libvirt
clang:freebsd12:amd64

00:01:43

passed #1222185
amd64 libvirt
clang:openbsd:amd64

00:04:10

passed #1222178
amd64 linux
clang:tsan

00:02:29

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

00:01:50

passed #1222175
amd64 linux
gcc:asan

00:03:38

passed #1222168
amd64 linux
gcc:buster:amd64

00:01:36

passed #1222164
amd64 linux
gcc:centos6:amd64

00:01:33

passed #1222165
amd64 linux
gcc:centos7:amd64

00:01:38

passed #1222166
amd64 linux
gcc:centos8:amd64

00:01:47

passed #1222174
amd64 linux
gcc:focal:amd64

00:01:46

passed #1222179
amd64 linux
gcc:mutexatomics

00:01:47

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

00:01:42

passed #1222169
amd64 linux
gcc:sid:amd64

00:02:30

passed #1222171
i386 linux
gcc:sid:i386

00:01:51

passed #1222181
amd64 linux
gcc:softhsm2.4

00:01:47

passed #1222182
amd64 linux
gcc:softhsm2.6

00:01:39

passed #1222167
amd64 linux
gcc:stretch:amd64

00:02:04

passed #1222177
amd64 linux
gcc:tsan

00:02:06

passed #1222172
amd64 linux
gcc:tumbleweed:amd64

00:01:30

passed #1222173
amd64 linux
gcc:xenial:amd64

00:01:53

passed #1222187
amd64 windows
msvc:windows:amd64

00:00:55

passed #1222186
amd64 linux
nolibtool:sid:amd64

00:02:15

 
  Unit
passed #1222200
amd64 linux
unit:clang:asan

00:00:59

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

00:00:37

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

00:01:04

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

00:01:05

passed #1222202
amd64 linux
unit:clang:tsan

00:01:38

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

00:00:48

passed #1222199
amd64 linux
unit:gcc:asan

00:00:51

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

00:00:38

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

00:00:38

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

00:00:40

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

00:00:38

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

00:00:35

passed #1222203
amd64 linux
unit:gcc:mutexatomics

00:00:37

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

00:00:35

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

00:00:51

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

00:00:39

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

00:00:41

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

00:00:39

passed #1222201
amd64 linux
unit:gcc:tsan

00:01:54

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

00:00:39

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

00:00:38

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

00:00:52

 
  System
passed #1222222
amd64 linux
system:clang:asan

00:12:54

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

00:10:40

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

00:10:34

failed #1222230
amd64 libvirt
system:clang:freebsd12:amd64

00:10:14

passed #1222224
amd64 linux
system:clang:tsan

00:14:27

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

00:11:37

passed #1222221
amd64 linux
system:gcc:asan

00:12:44

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

00:10:28

failed #1222211
amd64 linux
system:gcc:centos6:amd64

00:11:18

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

00:11:26

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

00:11:17

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

00:11:16

passed #1222225
amd64 linux
system:gcc:mutexatomics

00:10:31

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

00:11:06

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

00:10:46

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

00:10:39

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

00:11:04

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

00:11:08

passed #1222223
amd64 linux
system:gcc:tsan

00:14:49

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

00:11:01

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

00:10:37

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

00:11:34

 
  Docs
failed #1222232
amd64 linux
docs

00:02:12

 
  Postcheck
passed #1222236
amd64 linux
cppcheck

00:00:23

passed #1222233
amd64 linux
flake8

00:00:23

passed #1222234
amd64 linux
pylint

00:00:25

passed #1222235
amd64 linux
scan-build

00:09:19

 
Name Stage Failure
failed
system:gcc:centos6:amd64 System
I:The following system tests failed:
I: kasp
make: *** [test] Error 1
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 4385 files

Uploading artifacts as "archive" to coordinator... ok
id=1222211 responseStatus=201 Created token=atdgGoxx
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
system:clang:freebsd12:amd64 System
make: stopped in /builds/isc-projects/bind9/bin/tests/system
Uploading artifacts for failed job
Uploading artifacts...
Runtime platform
arch=amd64 os=freebsd pid=61799 revision=86ad88ea version=13.3.0
untracked: found 4527 files

Uploading artifacts as "archive" to coordinator... ok
id=1222230 responseStatus=201 Created token=WgGWWYRr
Cleaning up file based variables
Unsupported run stage 'cleanup_file_variables'
ERROR: Job failed: exit status 1
failed
docs Docs
	sed -e '${/^$/d;}' > CODE_OF_CONDUCT
$ if test "$(git status --porcelain | grep -Ev '\?\?' | grep -v -F -e aclocal.m4 -e configure -e ltmain.sh -e m4/ | wc -l)" -gt "0"; then git status --short; exit 1; fi
M aclocal.m4
M bin/named/bind9.xsl.h
M configure
M ltmain.sh
M m4/libtool.m4
Cleaning up file based variables
ERROR: Job failed: exit code 1