Bail-out early if dig fails to finish successfully or takes too long

Before, the zero system test could get stuck almost infinitely, because
the first test sends > 300 queries with 5 seconds timeout on each in
each pass.  If named crashed early, it would took the test more than 4
hours to properly timeout.

This commit introduces a "watchdog" on the dig commands running in the
background and failing the test on timeout, failing any test if any dig
command fails to return successfully, and making the tests.sh script
shellcheck clean.
69 jobs for !2712 with 1453-the-zero-system-test-timeouts-intermittently in 20 minutes and 45 seconds (queued for 9 seconds)
detached
Status Job ID Name Coverage
  Precheck
passed #462870
amd64 linux
🐞:sid:amd64

00:03:12

passed #462868
amd64 linux
autoreconf:sid:amd64

00:00:32

passed #462869
amd64 linux
misc:sid:amd64

00:00:17

 
  Build
passed #462884
amd64 linux
asan:sid:amd64

00:01:58

passed #462890
amd64 freebsd
clang:freebsd11.3:amd64

00:01:07

passed #462891
amd64 freebsd
clang:freebsd12.0:amd64

00:00:59

passed #462892
amd64 openbsd
clang:openbsd6.5:amd64

00:04:31

passed #462887
amd64 linux
clang:stretch:amd64

00:01:36

passed #462888
i386 linux
clang:stretch:i386

00:02:56

passed #462871
amd64 linux
gcc:alpine3.10:amd64

00:02:39

passed #462883
amd64 linux
gcc:bionic:amd64

00:01:15

passed #462877
amd64 linux
gcc:buster:amd64

00:01:45

passed #462872
amd64 linux
gcc:centos6:amd64

00:01:42

passed #462873
amd64 linux
gcc:centos7:amd64

00:02:04

passed #462874
amd64 linux
gcc:centos8:amd64

00:02:32

passed #462881
amd64 linux
gcc:fedora30:amd64

00:02:34

passed #462875
amd64 linux
gcc:jessie:amd64

00:01:08

passed #462878
amd64 linux
gcc:sid:amd64

00:02:26

passed #462879
i386 linux
gcc:sid:i386

00:01:34

passed #462876
amd64 linux
gcc:stretch:amd64

00:01:34

passed #462882
amd64 linux
gcc:xenial:amd64

00:02:02

passed #462894
amd64 windows
msvc:windows:amd64

00:02:21

passed #462886
amd64 linux
mutexatomics:sid:amd64

00:01:15

passed #462893
amd64 linux
nolibtool:sid:amd64

00:01:47

passed #462889
amd64 linux
pkcs11:sid:amd64

00:01:47

passed #462885
amd64 linux
rwlock:sid:amd64

00:01:17

 
  Unit
passed #462907
amd64 linux
unit:asan:sid:amd64

00:04:27

passed #462911
amd64 freebsd
unit:clang:freebsd11.3:amd64

00:00:31

passed #462912
amd64 freebsd
unit:clang:freebsd12.0:amd64

00:01:08

passed #462909
amd64 linux
unit:clang:stretch:amd64

00:00:49

passed #462895
amd64 linux
unit:gcc:alpine3.10:amd64

00:02:44

passed #462906
amd64 linux
unit:gcc:bionic:amd64

00:00:57

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

00:01:15

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

00:00:54

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

00:00:54

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

00:00:58

passed #462904
amd64 linux
unit:gcc:fedora30:amd64

00:01:29

passed #462899
amd64 linux
unit:gcc:jessie:amd64

00:00:29

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

00:01:15

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

00:01:50

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

00:00:43

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

00:00:55

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

00:01:36

passed #462910
amd64 linux
unit:pkcs11:sid:amd64

00:01:16

passed #462908
amd64 linux
unit:rwlock:sid:amd64

00:01:09

 
  System
passed #462926
amd64 linux
system:asan:sid:amd64

00:09:46

passed #462929
amd64 freebsd
system:clang:freebsd11.3:amd64

00:08:42

passed #462939
freebsd amd64
system:clang:freebsd12.0:amd64

00:08:18

passed #462914
amd64 linux
system:gcc:alpine3.10:amd64

00:08:37

passed #462925
amd64 linux
system:gcc:bionic:amd64

00:08:06

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

00:06:57

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

00:08:10

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

00:07:08

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

00:07:26

passed #462923
amd64 linux
system:gcc:fedora30:amd64

00:07:10

passed #462918
amd64 linux
system:gcc:jessie:amd64

00:06:57

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

00:08:36

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

00:07:35

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

00:08:20

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

00:07:37

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

00:08:27

passed #462928
amd64 linux
system:pkcs11:sid:amd64

00:08:20

passed #462927
amd64 linux
system:rwlock:sid:amd64

00:08:37

failed #462930
amd64 freebsd
system:clang:freebsd12.0:amd64

00:09:10

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

00:08:33

failed #462922
i386 linux
system:gcc:sid:i386

00:08:55

 
  Docs
passed #462932
amd64 linux
docs:sid:amd64

00:01:06

 
  Postcheck
passed #462934
amd64 linux
cppcheck:gcc:sid:amd64

00:01:42

passed #462933
amd64 linux
scan-build:buster:amd64

00:10:47