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>
76 jobs for !4257 with 2209-tsan-error-bin-named-controlconf-c-related in 17 minutes and 9 seconds (queued for 7 seconds)
detached
Status Job ID Name Coverage
  Autoconf
passed #1216753
amd64 linux
autoreconf

00:00:20

 
  Precheck
passed #1216755
amd64 linux
clang-format

00:00:21

passed #1216756
amd64 linux
coccinelle

00:03:30

passed #1216828
amd64 linux
danger

00:00:13

passed #1216754
amd64 linux
misc

00:00:15

passed #1216758
amd64 linux
tarball-create

00:01:51

failed #1216827
linux amd64
danger

00:00:12

failed #1216757
amd64 linux
danger

00:00:17

 
  Build
passed #1216771
amd64 linux
clang:asan

00:02:28

passed #1216775
amd64 linux
clang:buster:amd64

00:01:23

passed #1216778
amd64 libvirt
clang:freebsd11:amd64

00:01:06

passed #1216779
amd64 libvirt
clang:freebsd12:amd64

00:01:05

passed #1216780
amd64 libvirt
clang:openbsd:amd64

00:02:11

passed #1216773
amd64 linux
clang:tsan

00:01:34

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

00:01:00

passed #1216770
amd64 linux
gcc:asan

00:02:10

passed #1216763
amd64 linux
gcc:buster:amd64

00:01:16

passed #1216760
amd64 linux
gcc:centos7:amd64

00:01:01

passed #1216761
amd64 linux
gcc:centos8:amd64

00:01:18

passed #1216769
amd64 linux
gcc:focal:amd64

00:01:13

passed #1216774
amd64 linux
gcc:mutexatomics

00:01:09

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

00:01:26

passed #1216764
amd64 linux
gcc:sid:amd64

00:01:30

passed #1216766
i386 linux
gcc:sid:i386

00:01:12

passed #1216776
amd64 linux
gcc:softhsm2.4

00:01:07

passed #1216777
amd64 linux
gcc:softhsm2.6

00:01:08

passed #1216762
amd64 linux
gcc:stretch:amd64

00:01:15

passed #1216772
amd64 linux
gcc:tsan

00:01:19

passed #1216767
amd64 linux
gcc:tumbleweed:amd64

00:01:13

passed #1216768
amd64 linux
gcc:xenial:amd64

00:01:27

passed #1216781
amd64 windows
msvc:windows:amd64

00:00:46

 
  Unit
passed #1216793
amd64 linux
unit:clang:asan

00:01:16

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

00:00:57

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

00:01:31

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

00:01:17

passed #1216795
amd64 linux
unit:clang:tsan

00:02:55

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

00:01:03

passed #1216792
amd64 linux
unit:gcc:asan

00:01:11

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

00:01:03

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

00:01:05

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

00:01:01

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

00:00:58

passed #1216796
amd64 linux
unit:gcc:mutexatomics

00:01:03

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

00:01:00

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

00:01:05

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

00:01:00

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

00:01:01

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

00:01:04

passed #1216794
amd64 linux
unit:gcc:tsan

00:03:45

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

00:00:59

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

00:01:03

 
  System
passed #1216813
amd64 linux
system:clang:asan

00:12:25

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

00:11:20

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

00:10:47

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

00:10:41

passed #1216815
amd64 linux
system:clang:tsan

00:14:29

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

00:12:02

passed #1216812
amd64 linux
system:gcc:asan

00:13:10

failed #1216806
amd64 linux
system:gcc:buster:amd64

00:10:27

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

00:11:16

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

00:11:13

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

00:11:29

passed #1216816
amd64 linux
system:gcc:mutexatomics

00:10:39

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

00:11:37

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

00:11:12

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

00:11:20

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

00:11:43

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

00:11:18

passed #1216814
amd64 linux
system:gcc:tsan

00:14:51

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

00:11:00

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

00:10:23

 
  Docs
passed #1216822
amd64 linux
docs

00:00:37

 
  Postcheck
passed #1216826
amd64 linux
cppcheck

00:00:45

passed #1216823
amd64 linux
flake8

00:00:34

passed #1216824
amd64 linux
pylint

00:00:40

passed #1216825
amd64 linux
scan-build

00:04:18

 
Name Stage Failure
failed
system:gcc:buster:amd64 System
FAIL legacy (exit status: 1)

$ test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 1566 files

Uploading artifacts as "archive" to coordinator... ok
id=1216806 responseStatus=201 Created token=Qb_Rf4bK
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
system:clang:freebsd12:amd64 System
$ test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
Uploading artifacts for failed job
Uploading artifacts...
Runtime platform
arch=amd64 os=freebsd pid=59924 revision=86ad88ea version=13.3.0
untracked: found 1523 files

Uploading artifacts as "archive" to coordinator... ok
id=1216821 responseStatus=201 Created token=YRBKhzvs
Cleaning up file based variables
Unsupported run stage 'cleanup_file_variables'
ERROR: Job failed: exit status 1