Destroy query in killoldestquery under a lock.

Fixes a race between ns_client_killoldestquery and ns_client_endrequest -
killoldestquery takes a client from `recursing` list while endrequest
destroys client object, then killoldestquery works on a destroyed client
object. Prevent it by holding reclist lock while cancelling query.

(cherry picked from commit df3dbdff)
83 jobs for !3162 with 1650-fix-race-in-killoldestclient-v9_16 in 35 minutes and 33 seconds (queued for 4 seconds)
detached
Status Job ID Name Coverage
  Precheck
passed #736436
amd64 linux
🐞:sid:amd64

00:03:18

passed #736435
amd64 linux
💾:sid:amd64

00:00:20

passed #736433
amd64 linux
autoreconf:sid:amd64

00:00:32

passed #736434
amd64 linux
misc:sid:amd64

00:00:18

 
  Build
passed #736452
amd64 linux
asan:sid:amd64

00:03:15

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

00:01:06

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

00:00:57

passed #736461
amd64 libvirt
clang:openbsd6.6:amd64

00:05:01

passed #736456
amd64 linux
clang:stretch:amd64

00:01:57

passed #736457
i386 linux
clang:stretch:i386

00:01:27

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

00:02:28

passed #736451
amd64 linux
gcc:bionic:amd64

00:02:08

passed #736443
amd64 linux
gcc:buster:amd64

00:01:38

passed #736438
amd64 linux
gcc:centos6:amd64

00:02:06

passed #736439
amd64 linux
gcc:centos7:amd64

00:02:14

passed #736440
amd64 linux
gcc:centos8:amd64

00:02:24

passed #736449
amd64 linux
gcc:fedora31:amd64

00:02:26

passed #736441
amd64 linux
gcc:jessie:amd64

00:01:27

passed #736444
amd64 linux
gcc:sid:amd64

00:03:30

passed #736446
arm64 linux
gcc:sid:arm64

00:19:09

passed #736447
i386 linux
gcc:sid:i386

00:01:33

passed #736442
amd64 linux
gcc:stretch:amd64

00:01:40

passed #736448
amd64 linux
gcc:tumbleweed:amd64

00:02:17

passed #736450
amd64 linux
gcc:xenial:amd64

00:01:50

passed #736463
amd64 windows
msvc:windows:amd64

00:02:40

passed #736455
amd64 linux
mutexatomics:sid:amd64

00:01:43

passed #736462
amd64 linux
nolibtool:sid:amd64

00:02:30

passed #736445
amd64 linux
oot:sid:amd64

00:02:31

passed #736458
amd64 linux
pkcs11:sid:amd64

00:01:59

passed #736454
amd64 linux
rwlock:sid:amd64

00:03:06

passed #736453
amd64 linux
tsan:buster:amd64

00:03:17

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

00:01:12

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

00:00:32

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

00:00:33

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

00:00:53

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

00:01:02

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

00:00:52

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

00:00:52

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

00:00:56

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

00:00:58

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

00:00:55

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

00:00:51

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

00:00:32

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

00:00:41

passed #736472
arm64 linux
unit:gcc:sid:arm64

00:00:58

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

00:00:55

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

00:00:51

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

00:00:41

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

00:00:42

passed #736481
amd64 linux
unit:mutexatomics:sid:amd64

00:00:51

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

00:01:19

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

00:00:53

passed #736480
amd64 linux
unit:rwlock:sid:amd64

00:01:01

failed #736479
amd64 linux allowed to fail
unit:tsan:buster:amd64

00:02:21

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

00:12:36

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

00:11:09

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

00:11:12

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

00:10:31

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

00:08:33

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

00:11:31

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

00:09:30

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

00:10:55

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

00:09:49

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

00:09:57

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

00:09:51

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

00:09:36

passed #736519
linux arm64
system:gcc:sid:arm64

00:10:25

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

00:11:40

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

00:11:21

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

00:10:56

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

00:10:13

passed #736504
amd64 linux
system:mutexatomics:sid:amd64

00:11:28

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

00:10:42

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

00:10:26

passed #736503
amd64 linux
system:rwlock:sid:amd64

00:09:30

failed #736502
amd64 linux allowed to fail
system:tsan:buster:amd64

00:14:40

failed #736487
amd64 linux
system:gcc:alpine3.11:amd64

00:10:58

failed #736500
amd64 linux
system:gcc:bionic:amd64

00:09:17

failed #736495
arm64 linux
system:gcc:sid:arm64

00:12:49

 
  Docs
passed #736509
amd64 linux
docs:sid:amd64

00:01:02

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

00:02:40

passed #736512
arm64 linux
cppcheck:gcc:sid:arm64

00:02:07

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

00:11:23

 
Name Stage Failure
failed
system:tsan:buster:amd64 System
No job log
failed
unit:tsan:buster:amd64 Unit
No job log