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)
merge request