Fix datarace when UDP/TCP connect fails and we are in nmthread

When we were in nmthread, the isc__nm_async_<proto>connect() function
executes in the same thread as the isc__nm_<proto>connect() and on a
failure, it would block indefinitely because the failure branch was
setting sock->active to false before the condition around the wait had a
chance to skip the WAIT().

This also fixes the zero system test being stuck on FreeBSD 11, so we
re-enable the test in the commit.
79 jobs for !4468 with 2314-fix-datarace-in-nm-connect-functions in 31 minutes and 45 seconds (queued for 11 seconds)
detached
Status Job ID Name Coverage
  Autoconf
passed #1343908
amd64 linux
autoreconf

00:00:17

 
  Precheck
passed #1343910
amd64 linux
clang-format

00:00:17

passed #1343911
amd64 linux
coccinelle

00:03:23

passed #1344063
linux amd64
danger

00:00:14

passed #1343909
amd64 linux
misc

00:00:18

passed #1343913
amd64 linux
tarball-create

00:01:33

failed #1343912
amd64 linux
danger

00:00:14

 
  Build
passed #1343926
amd64 linux
clang:asan

00:01:57

passed #1343930
amd64 linux
clang:buster:amd64

00:01:00

passed #1343933
amd64 libvirt
clang:freebsd11:amd64

00:01:05

passed #1343934
amd64 libvirt
clang:freebsd12:amd64

00:01:07

passed #1343935
amd64 libvirt
clang:openbsd:amd64

00:02:16

passed #1343928
amd64 linux
clang:tsan

00:01:05

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

00:00:49

passed #1343925
amd64 linux
gcc:asan

00:01:42

passed #1343918
amd64 linux
gcc:buster:amd64

00:00:54

passed #1343915
amd64 linux
gcc:centos7:amd64

00:00:44

passed #1343916
amd64 linux
gcc:centos8:amd64

00:00:49

passed #1343924
amd64 linux
gcc:focal:amd64

00:00:52

passed #1343929
amd64 linux
gcc:mutexatomics

00:00:45

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

00:01:07

passed #1343919
amd64 linux
gcc:sid:amd64

00:01:46

passed #1343921
i386 linux
gcc:sid:i386

00:01:08

passed #1343931
amd64 linux
gcc:softhsm2.4

00:00:45

passed #1343932
amd64 linux
gcc:softhsm2.6

00:00:51

passed #1343917
amd64 linux
gcc:stretch:amd64

00:01:10

passed #1343927
amd64 linux
gcc:tsan

00:00:59

passed #1343922
amd64 linux
gcc:tumbleweed:amd64

00:00:46

passed #1343923
amd64 linux
gcc:xenial:amd64

00:00:52

passed #1343936
amd64 windows
msvc:windows:amd64

00:00:46

 
  Unit
passed #1343948
amd64 linux
unit:clang:asan

00:01:23

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

00:01:05

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

00:01:33

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

00:01:34

passed #1343957
amd64 libvirt
unit:clang:openbsd:amd64

00:02:51

passed #1343950
amd64 linux
unit:clang:tsan

00:03:01

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

00:01:06

passed #1343947
amd64 linux
unit:gcc:asan

00:01:24

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

00:02:08

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

00:01:10

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

00:01:05

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

00:01:08

passed #1343951
amd64 linux
unit:gcc:mutexatomics

00:01:03

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

00:01:09

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

00:01:09

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

00:01:04

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

00:01:07

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

00:01:06

passed #1343949
amd64 linux
unit:gcc:tsan

00:03:45

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

00:01:05

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

00:01:11

 
  System
passed #1343969
amd64 linux
system:clang:asan

00:13:22

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

00:11:56

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

00:11:53

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

00:11:38

failed #1343971
amd64 linux allowed to fail
system:clang:tsan

00:15:20

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

00:12:03

passed #1343968
amd64 linux
system:gcc:asan

00:13:31

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

00:12:48

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

00:11:55

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

00:12:18

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

00:12:32

passed #1343972
amd64 linux
system:gcc:mutexatomics

00:11:34

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

00:12:01

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

00:12:15

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

00:11:48

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

00:12:03

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

00:11:45

passed #1343970
amd64 linux
system:gcc:tsan

00:15:38

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

00:12:19

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

00:11:16

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

00:11:26

failed #1343958
amd64 linux
system:gcc:alpine3.12:amd64

00:12:39

 
  Docs
passed #1343978
amd64 linux
docs

00:00:31

 
  Postcheck
passed #1343982
amd64 linux
cppcheck

00:00:44

passed #1343979
amd64 linux
flake8

00:00:19

passed #1343983
amd64 linux
gcov

00:00:33

77.0%
passed #1343980
amd64 linux
pylint

00:00:22

passed #1343981
amd64 linux
scan-build

00:03:51

 
Name Stage Failure
failed
system:clang:freebsd12:amd64 System
No job log
failed
system:clang:tsan System
No job log