Put up additional safe guards to not use inactive/closed tcpdns socket

When we are operating on the tcpdns socket, we need to double check
whether the socket or its outerhandle or its listener or its mgr is
still active and when not, bail out early.
81 jobs for !4344 with 2227-tcp-connection-closed-second-fix-v9_16 in 27 minutes and 33 seconds (queued for 8 seconds)
detached
Status Job ID Name Coverage
  Precheck
passed #1267379
amd64 linux
autoreconf

00:00:15

passed #1267381
amd64 linux
clang-format

00:00:16

passed #1267382
amd64 linux
coccinelle

00:03:15

passed #1267383
amd64 linux
danger

00:00:16

passed #1267380
amd64 linux
misc

00:00:16

 
  Build
passed #1267397
amd64 linux
clang:asan

00:04:02

passed #1267401
amd64 linux
clang:buster:amd64

00:02:00

passed #1267404
amd64 libvirt
clang:freebsd11:amd64

00:01:54

passed #1267405
amd64 libvirt
clang:freebsd12:amd64

00:01:51

passed #1267406
amd64 libvirt
clang:openbsd:amd64

00:04:02

passed #1267399
amd64 linux
clang:tsan

00:02:16

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

00:01:40

passed #1267396
amd64 linux
gcc:asan

00:03:22

passed #1267389
amd64 linux
gcc:buster:amd64

00:01:37

passed #1267385
amd64 linux
gcc:centos6:amd64

00:01:26

passed #1267386
amd64 linux
gcc:centos7:amd64

00:01:40

passed #1267387
amd64 linux
gcc:centos8:amd64

00:01:43

passed #1267395
amd64 linux
gcc:focal:amd64

00:01:29

passed #1267400
amd64 linux
gcc:mutexatomics

00:01:37

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

00:01:39

passed #1267390
amd64 linux
gcc:sid:amd64

00:02:17

passed #1267392
i386 linux
gcc:sid:i386

00:01:49

passed #1267402
amd64 linux
gcc:softhsm2.4

00:01:45

passed #1267403
amd64 linux
gcc:softhsm2.6

00:01:39

passed #1267388
amd64 linux
gcc:stretch:amd64

00:02:00

passed #1267398
amd64 linux
gcc:tsan

00:02:02

passed #1267393
amd64 linux
gcc:tumbleweed:amd64

00:01:34

passed #1267394
amd64 linux
gcc:xenial:amd64

00:01:34

passed #1267408
amd64 windows
msvc:windows:amd64

00:02:18

passed #1267407
amd64 linux
nolibtool:sid:amd64

00:02:08

 
  Unit
passed #1267421
amd64 linux
unit:clang:asan

00:00:53

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

00:00:35

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

00:01:06

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

00:01:06

passed #1267423
amd64 linux
unit:clang:tsan

00:01:31

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

00:00:50

passed #1267420
amd64 linux
unit:gcc:asan

00:00:50

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

00:00:38

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

00:00:39

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

00:00:45

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

00:00:40

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

00:00:39

passed #1267424
amd64 linux
unit:gcc:mutexatomics

00:00:40

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

00:00:35

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

00:00:40

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

00:00:38

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

00:00:42

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

00:00:35

passed #1267422
amd64 linux
unit:gcc:tsan

00:01:42

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

00:00:38

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

00:00:44

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

00:00:52

 
  System
passed #1267443
amd64 linux
system:clang:asan

00:11:45

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

00:10:18

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

00:10:44

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

00:10:02

passed #1267445
amd64 linux
system:clang:tsan

00:13:40

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

00:11:51

passed #1267442
amd64 linux
system:gcc:asan

00:12:24

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

00:10:23

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

00:11:02

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

00:10:42

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

00:10:57

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

00:11:11

passed #1267446
amd64 linux
system:gcc:mutexatomics

00:10:02

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

00:10:53

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

00:09:44

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

00:10:33

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

00:10:58

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

00:10:25

passed #1267444
amd64 linux
system:gcc:tsan

00:14:06

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

00:10:38

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

00:10:16

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

00:11:25

failed #1267447
amd64 linux
system:clang:buster:amd64

00:10:18

failed #1267433
amd64 linux
system:gcc:centos7:amd64

00:11:07

 
  Docs
passed #1267453
amd64 linux
docs

00:01:59

 
  Postcheck
passed #1267457
amd64 linux
cppcheck

00:00:20

passed #1267454
amd64 linux
flake8

00:00:17

passed #1267455
amd64 linux
pylint

00:00:26

passed #1267456
amd64 linux
scan-build

00:09:05