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)
70 jobs for !2874 with 1443-threadsanitizer-data-race-lib-dns-rbtdb-c-1960-in-decrement_reference-2-v9_11 in 22 minutes and 13 seconds (queued for 4 seconds)
latest detached
Status Job ID Name Coverage
  Precheck
passed #558499
amd64 linux
🐞:sid:amd64

00:01:16

passed #558497
amd64 linux
autoreconf:sid:amd64

00:00:33

passed #558498
amd64 linux
misc:sid:amd64

00:00:19

 
  Build
passed #558514
amd64 linux
asan:sid:amd64

00:03:38

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

00:01:27

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

00:01:12

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

00:08:45

passed #558515
amd64 linux
clang:stretch:amd64

00:01:54

passed #558516
i386 linux
clang:stretch:i386

00:01:43

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

00:02:58

passed #558513
amd64 linux
gcc:bionic:amd64

00:01:40

passed #558506
amd64 linux
gcc:buster:amd64

00:01:51

passed #558501
amd64 linux
gcc:centos6:amd64

00:02:25

passed #558502
amd64 linux
gcc:centos7:amd64

00:02:35

passed #558503
amd64 linux
gcc:centos8:amd64

00:02:32

passed #558511
amd64 linux
gcc:fedora31:amd64

00:02:33

passed #558504
amd64 linux
gcc:jessie:amd64

00:01:49

passed #558507
amd64 linux
gcc:sid:amd64

00:02:49

passed #558509
i386 linux
gcc:sid:i386

00:01:56

passed #558505
amd64 linux
gcc:stretch:amd64

00:03:53

passed #558510
amd64 linux
gcc:tumbleweed:amd64

00:02:28

passed #558512
amd64 linux
gcc:xenial:amd64

00:01:41

passed #558523
amd64 windows
msvc:windows:amd64

00:02:15

passed #558517
amd64 linux
nocrypto:sid:amd64

00:01:23

passed #558522
amd64 linux
nolibtool:sid:amd64

00:02:21

passed #558508
amd64 linux
oot:sid:amd64

00:04:04

passed #558518
amd64 linux
pkcs11:sid:amd64

00:01:36

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

00:02:07

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

00:00:33

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

00:00:27

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

00:00:49

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

00:00:49

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

00:01:05

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

00:00:52

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

00:01:09

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

00:01:03

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

00:00:58

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

00:00:56

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

00:00:29

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

00:00:36

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

00:00:52

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

00:01:04

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

00:00:42

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

00:00:49

passed #558539
amd64 linux
unit:nocrypto:sid:amd64

00:00:55

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

00:01:19

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

00:00:56

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

00:09:42

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

00:06:52

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

00:06:46

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

00:07:47

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

00:07:36

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

00:07:42

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

00:07:38

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

00:07:29

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

00:07:43

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

00:07:32

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

00:07:19

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

00:07:23

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

00:07:54

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

00:07:02

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

00:07:27

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

00:07:17

passed #558558
amd64 linux
system:nocrypto:sid:amd64

00:03:57

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

00:07:21

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

00:07:36

failed #558549
amd64 linux
system:gcc:stretch:amd64

00:07:44

 
  Docs
passed #558563
amd64 linux
docs:sid:amd64

00:01:01

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

00:01:03

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

00:12:20