Add is_leaf and send_to_prune_tree.

Add is_leaf and send_to_prune_tree to make the logic easier
to understand in cleanup_dead_nodes and decrement_reference.

(cherry picked from commit c6efc0e5)
69 jobs for !2873 with 1443-threadsanitizer-data-race-lib-dns-rbtdb-c-1960-in-decrement_reference-2-v9_14 in 27 minutes and 26 seconds (queued for 5 seconds)
detached
Status Job ID Name Coverage
  Precheck
passed #558568
amd64 linux
🐞:sid:amd64

00:00:59

passed #558566
amd64 linux
autoreconf:sid:amd64

00:00:33

passed #558567
amd64 linux
misc:sid:amd64

00:00:18

 
  Build
passed #558583
amd64 linux
asan:sid:amd64

00:01:50

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

00:01:30

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

00:01:22

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

00:06:47

passed #558584
amd64 linux
clang:stretch:amd64

00:01:52

passed #558585
i386 linux
clang:stretch:i386

00:01:46

passed #558569
amd64 linux
gcc:alpine3.11:amd64

00:02:48

passed #558582
amd64 linux
gcc:bionic:amd64

00:01:19

passed #558575
amd64 linux
gcc:buster:amd64

00:01:48

passed #558570
amd64 linux
gcc:centos6:amd64

00:02:23

passed #558571
amd64 linux
gcc:centos7:amd64

00:02:34

passed #558572
amd64 linux
gcc:centos8:amd64

00:02:41

passed #558580
amd64 linux
gcc:fedora31:amd64

00:02:18

passed #558573
amd64 linux
gcc:jessie:amd64

00:01:41

passed #558576
amd64 linux
gcc:sid:amd64

00:02:36

passed #558578
i386 linux
gcc:sid:i386

00:01:43

passed #558574
amd64 linux
gcc:stretch:amd64

00:01:45

passed #558579
amd64 linux
gcc:tumbleweed:amd64

00:03:04

passed #558581
amd64 linux
gcc:xenial:amd64

00:01:19

passed #558591
amd64 windows
msvc:windows:amd64

00:02:38

passed #558590
amd64 linux
nolibtool:sid:amd64

00:01:46

passed #558577
amd64 linux
oot:sid:amd64

00:01:50

passed #558586
amd64 linux
pkcs11:sid:amd64

00:01:26

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

00:00:56

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

00:00:25

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

00:00:25

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

00:00:46

passed #558592
amd64 linux
unit:gcc:alpine3.11:amd64

00:00:49

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

00:00:47

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

00:00:47

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

00:00:49

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

00:00:40

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

00:00:50

passed #558602
amd64 linux
unit:gcc:fedora31:amd64

00:00:36

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

00:00:36

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

00:00:49

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

00:00:49

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

00:00:48

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

00:00:58

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

00:00:50

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

00:01:03

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

00:00:46

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

00:11:25

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

00:09:22

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

00:09:00

passed #558611
amd64 linux
system:gcc:alpine3.11:amd64

00:10:18

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

00:09:29

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

00:10:28

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

00:09:19

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

00:08:46

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

00:10:38

passed #558635
linux amd64
system:gcc:fedora31:amd64

00:08:56

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

00:09:24

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

00:09:32

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

00:12:10

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

00:09:25

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

00:09:48

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

00:09:22

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

00:09:16

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

00:11:43

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

00:09:36

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

00:09:40

failed #558621
amd64 linux
system:gcc:fedora31:amd64

00:12:19

 
  Docs
passed #558629
amd64 linux
docs:sid:amd64

00:01:05

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

00:02:48

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

00:10:33