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
linux amd64
autoreconf

00:00:17

passed #1222160
linux amd64
clang-format

00:00:18

passed #1222161
linux amd64
coccinelle

00:03:37

passed #1222162
linux amd64
danger

00:00:16

passed #1222159
linux amd64
misc

00:00:15

 
  Build
passed #1222176
linux amd64
clang:asan

00:04:13

passed #1222180
linux amd64
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
linux amd64
clang:tsan

00:02:29

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

00:01:50

passed #1222175
linux amd64
gcc:asan

00:03:38

passed #1222168
linux amd64
gcc:buster:amd64

00:01:36

passed #1222164
linux amd64
gcc:centos6:amd64

00:01:33

passed #1222165
linux amd64
gcc:centos7:amd64

00:01:38

passed #1222166
linux amd64
gcc:centos8:amd64

00:01:47

passed #1222174
linux amd64
gcc:focal:amd64

00:01:46

passed #1222179
linux amd64
gcc:mutexatomics

00:01:47

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

00:01:42

passed #1222169
linux amd64
gcc:sid:amd64

00:02:30

passed #1222171
linux i386
gcc:sid:i386

00:01:51

passed #1222181
linux amd64
gcc:softhsm2.4

00:01:47

passed #1222182
linux amd64
gcc:softhsm2.6

00:01:39

passed #1222167
linux amd64
gcc:stretch:amd64

00:02:04

passed #1222177
linux amd64
gcc:tsan

00:02:06

passed #1222172
linux amd64
gcc:tumbleweed:amd64

00:01:30

passed #1222173
linux amd64
gcc:xenial:amd64

00:01:53

passed #1222187
amd64 windows
msvc:windows:amd64

00:00:55

passed #1222186
linux amd64
nolibtool:sid:amd64

00:02:15

 
  Unit
passed #1222200
linux amd64
unit:clang:asan

00:00:59

passed #1222204
linux amd64
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
linux amd64
unit:clang:tsan

00:01:38

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

00:00:48

passed #1222199
linux amd64
unit:gcc:asan

00:00:51

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

00:00:38

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

00:00:38

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

00:00:40

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

00:00:38

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

00:00:35

passed #1222203
linux amd64
unit:gcc:mutexatomics

00:00:37

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

00:00:35

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

00:00:51

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

00:00:39

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

00:00:41

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

00:00:39

passed #1222201
linux amd64
unit:gcc:tsan

00:01:54

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

00:00:39

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

00:00:38

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

00:00:52

 
  System
passed #1222222
linux amd64
system:clang:asan

00:12:54

passed #1222226
linux amd64
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
linux amd64
system:clang:tsan

00:14:27

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

00:11:37

passed #1222221
linux amd64
system:gcc:asan

00:12:44

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

00:10:28

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

00:11:18

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

00:11:26

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

00:11:17

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

00:11:16

passed #1222225
linux amd64
system:gcc:mutexatomics

00:10:31

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

00:11:06

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

00:10:46

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

00:10:39

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

00:11:04

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

00:11:08

passed #1222223
linux amd64
system:gcc:tsan

00:14:49

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

00:11:01

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

00:10:37

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

00:11:34

 
  Docs
failed #1222232
linux amd64
docs

00:02:12

 
  Postcheck
passed #1222236
linux amd64
cppcheck

00:00:23

passed #1222233
linux amd64
flake8

00:00:23

passed #1222234
linux amd64
pylint

00:00:25

passed #1222235
linux amd64
scan-build

00:09:19

 
Name Stage Failure
failed
system:gcc:centos6:amd64 System
No job log
failed
system:clang:freebsd12:amd64 System
No job log
failed
docs Docs
No job log