Pause the dbiterator when dumping the zone to the disk

When we rewrote the zone dumping to use the separate threadpool, the
dumping would acquire the read lock for the whole time the zone dumping
process is dumping the zone.

When combined with incoming IXFR that tries to acquire the write lock on
the same rwlock, we would end up blocking all the other readers.

In this commit, we pause the dbiterator every time we get next record
and before start dumping it to the disk.
75 jobs for !5150 with 2732-pause-the-dbiterator-in-dumptostream in 32 minutes and 44 seconds (queued for 8 seconds)
latest detached
Status Job ID Name Coverage
  Autoconf
passed #1775465
amd64 linux
autoreconf

00:00:17

 
  Precheck
passed #1775467
amd64 linux
clang-format

00:00:18

passed #1775468
amd64 linux
coccinelle

00:03:59

passed #1775469
amd64 linux
danger

00:00:15

passed #1775466
amd64 linux
misc

00:00:18

passed #1775470
amd64 linux
tarball-create

00:01:27

 
  Build
passed #1775483
amd64 linux
clang:asan

00:02:03

passed #1775487
amd64 linux
clang:buster:amd64

00:01:05

passed #1775490
amd64 libvirt
clang:freebsd12:amd64

00:01:14

passed #1775491
amd64 libvirt
clang:freebsd13:amd64

00:02:58

passed #1775492
amd64 libvirt
clang:openbsd:amd64

00:02:20

passed #1775485
amd64 linux
clang:tsan

00:01:18

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

00:01:06

passed #1775482
amd64 linux
gcc:asan

00:01:43

passed #1775480
amd64 linux
gcc:bionic:amd64

00:01:05

passed #1775475
amd64 linux
gcc:buster:amd64

00:00:51

passed #1775472
amd64 linux
gcc:centos7:amd64

00:00:55

passed #1775473
amd64 linux
gcc:centos8:amd64

00:00:54

passed #1775481
amd64 linux
gcc:focal:amd64

00:01:03

passed #1775486
amd64 linux
gcc:mutexatomics

00:00:53

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

00:01:01

passed #1775476
amd64 linux
gcc:sid:amd64

00:01:12

passed #1775488
amd64 linux
gcc:softhsm2.4

00:00:59

passed #1775489
amd64 linux
gcc:softhsm2.6

00:00:56

passed #1775474
amd64 linux
gcc:stretch:amd64

00:01:08

passed #1775478
amd64 linux
gcc:tarball

00:01:01

passed #1775484
amd64 linux
gcc:tsan

00:01:09

passed #1775479
amd64 linux
gcc:tumbleweed:amd64

00:01:00

passed #1775493
amd64 windows
msvc:windows:amd64

00:00:46

 
  Unit
passed #1775504
amd64 linux
unit:clang:asan

00:02:06

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

00:01:22

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

00:01:43

passed #1775512
amd64 libvirt
unit:clang:freebsd13:amd64

00:03:32

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

00:03:17

passed #1775506
amd64 linux
unit:clang:tsan

00:03:38

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

00:01:41

passed #1775503
amd64 linux
unit:gcc:asan

00:02:08

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

00:01:22

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

00:02:29

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

00:01:30

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

00:01:21

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

00:01:33

passed #1775507
amd64 linux
unit:gcc:mutexatomics

00:01:32

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

00:01:26

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

00:01:26

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

00:01:27

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

00:00:18

passed #1775505
amd64 linux
unit:gcc:tsan

00:04:25

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

00:01:26

 
  System
passed #1775524
amd64 linux
system:clang:asan

00:14:28

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

00:12:01

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

00:11:44

passed #1775539
libvirt amd64
system:clang:freebsd13:amd64

00:13:28

passed #1775526
amd64 linux
system:clang:tsan

00:16:28

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

00:12:42

passed #1775523
amd64 linux
system:gcc:asan

00:14:59

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

00:11:39

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

00:14:11

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

00:12:07

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

00:12:12

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

00:12:26

passed #1775527
amd64 linux
system:gcc:mutexatomics

00:12:52

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

00:12:06

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

00:12:00

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

00:12:33

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

00:12:27

passed #1775525
amd64 linux
system:gcc:tsan

00:16:55

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

00:12:02

failed #1775532
amd64 libvirt
system:clang:freebsd13:amd64

00:13:27

 
  Docs
passed #1775533
amd64 linux
docs

00:01:03

 
  Postcheck
passed #1775537
amd64 linux
cppcheck

00:00:46

passed #1775534
amd64 linux
flake8

00:00:23

passed #1775538
amd64 linux
gcov

00:00:32

78.0%
passed #1775535
amd64 linux
pylint

00:00:30

passed #1775536
amd64 linux
scan-build

00:05:00