Refactor taskmgr to run on top of netmgr

This commit changes the taskmgr to run the individual tasks on the
netmgr internal workers.  While an effort has been put into keeping
the taskmgr interface intact, couple of changes have been made:

 * The taskmgr has no concept of universal privileged mode - rather the
   tasks are either privileged or unprivileged (normal).  The privileged
   tasks are run as a first thing when the netmgr is unpaused.  There are
   now four different queues in in the netmgr:

   1. priority queue - netievent on the priority queue are run even when
      the taskmgr enter exclusive mode and netmgr is paused.  This is
      needed to properly start listening on the interfaces, free
      resources and resume.

   2. privileged task queue - only privileged tasks are queued here and
      this is the first queue that gets processed when network manager
      is unpaused using isc_nm_resume().  All netmgr workers need to
      clean the privileged task queue before they all proceed normal
      operation.  Both task queues are processed when the workers are
      finished.

   3. task queue - only (traditional) task are scheduled here and this
      queue along with privileged task queues are process when the
      netmgr workers are finishing.  This is needed to process the task
      shutdown events.

   4. normal queue - this is the queue with netmgr events, e.g. reading,
      sending, callbacks and pretty much everything is processed here.

 * The isc_taskmgr_create() now requires initialized netmgr (isc_nm_t)
   object.

 * The isc_nm_destroy() function now waits for indefinite time, but it
   will print out the active objects when in tracing mode
   (-DNETMGR_TRACE=1 and -DNETMGR_TRACE_VERBOSE=1), the netmgr has been
   made a little bit more asynchronous and it might take longer time to
   shutdown all the active networking connections.

 * Previously, the isc_nm_stoplistening() was a synchronous operation.
   This has been changed and the isc_nm_stoplistening() just schedules
   the child sockets to stop listening and exits.  This was needed to
   prevent a deadlock as the the (traditional) tasks are now executed on
   the netmgr threads.

 * The socket selection logic in isc__nm_udp_send() was flawed, but
   fortunatelly, it was broken, so we never hit the problem where we
   created uvreq_t on a socket from nmhandle_t, but then a different
   socket could be picked up and then we were trying to run the send
   callback on a socket that had different threadid than currently
   running.
71 jobs for !4891 with ondrej/move-tasks-and-timers-to-netmgr in 33 minutes and 38 seconds (queued for 23 seconds)
latest detached
Status Job ID Name Coverage
  Autoconf
passed #1649416
amd64 linux
autoreconf

00:00:24

 
  Precheck
failed #1649418
amd64 linux
clang-format

00:00:26

failed #1649419
amd64 linux
coccinelle

00:03:41

failed #1649420
amd64 linux
danger

00:00:26

passed #1649417
amd64 linux
misc

00:00:29

passed #1649421
amd64 linux
tarball-create

00:01:36

 
  Build
passed #1649432
amd64 linux
clang:asan

00:02:07

passed #1649436
amd64 linux
clang:buster:amd64

00:01:04

passed #1649439
amd64 libvirt
clang:freebsd11:amd64

00:01:17

passed #1649440
amd64 libvirt
clang:freebsd12:amd64

00:01:06

passed #1649441
amd64 libvirt
clang:openbsd:amd64

00:02:35

passed #1649434
amd64 linux
clang:tsan

00:01:19

passed #1649422
amd64 linux
gcc:alpine3.13:amd64

00:01:05

passed #1649431
amd64 linux
gcc:asan

00:01:43

passed #1649426
amd64 linux
gcc:buster:amd64

00:00:45

passed #1649423
amd64 linux
gcc:centos7:amd64

00:00:48

passed #1649424
amd64 linux
gcc:centos8:amd64

00:01:03

passed #1649430
amd64 linux
gcc:focal:amd64

00:00:57

passed #1649435
amd64 linux
gcc:mutexatomics

00:00:47

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

00:01:00

passed #1649427
amd64 linux
gcc:sid:amd64

00:01:05

passed #1649437
amd64 linux
gcc:softhsm2.4

00:01:01

passed #1649438
amd64 linux
gcc:softhsm2.6

00:00:59

passed #1649425
amd64 linux
gcc:stretch:amd64

00:01:00

passed #1649433
amd64 linux
gcc:tsan

00:01:06

passed #1649429
amd64 linux
gcc:tumbleweed:amd64

00:00:51

passed #1649442
amd64 windows
msvc:windows:amd64

00:01:07

 
  Unit
passed #1649452
amd64 linux
unit:clang:asan

00:02:12

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

00:01:23

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

00:02:00

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

00:01:48

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

00:03:22

passed #1649454
amd64 linux
unit:clang:tsan

00:03:25

passed #1649443
amd64 linux
unit:gcc:alpine3.13:amd64

00:01:36

passed #1649451
amd64 linux
unit:gcc:asan

00:01:50

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

00:02:24

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

00:01:28

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

00:01:21

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

00:01:25

passed #1649455
amd64 linux
unit:gcc:mutexatomics

00:01:28

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

00:01:27

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

00:01:27

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

00:01:18

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

00:00:15

passed #1649453
amd64 linux
unit:gcc:tsan

00:04:14

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

00:01:27

 
  System
passed #1649471
amd64 linux
system:clang:asan

00:14:49

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

00:12:42

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

00:12:03

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

00:12:01

passed #1649473
amd64 linux
system:clang:tsan

00:18:00

passed #1649462
amd64 linux
system:gcc:alpine3.13:amd64

00:13:13

passed #1649470
amd64 linux
system:gcc:asan

00:14:59

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

00:14:06

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

00:12:30

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

00:12:36

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

00:12:38

passed #1650365
amd64 linux
system:gcc:mutexatomics

00:12:44

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

00:12:17

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

00:12:42

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

00:12:15

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

00:12:20

passed #1649472
amd64 linux
system:gcc:tsan

00:18:24

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

00:12:35

failed #1649474
amd64 linux
system:gcc:mutexatomics

00:13:12

 
  Docs
passed #1649480
amd64 linux
docs

00:00:54

 
  Postcheck
passed #1649484
amd64 linux
cppcheck

00:00:53

passed #1649481
amd64 linux
flake8

00:00:22

passed #1649485
amd64 linux
gcov

00:00:33

77.0%
passed #1649482
amd64 linux
pylint

00:00:21

passed #1649483
amd64 linux
scan-build

00:04:06

 
Name Stage Failure
failed
coccinelle Precheck
No job log
failed
danger Precheck
No job log
failed
clang-format Precheck
No job log