Ensure ns_query_cancel() handles all recursions

Previously, multiple code paths reused client->query.fetch, so it was
enough for ns_query_cancel() to issue a single call to
dns_resolver_cancelfetch() with that fetch as an argument.  Now, since
each slot in the 'recursions' array can hold a reference to a separate
resolver fetch, ns_query_cancel() needs to handle all of them, so that
all recursion callbacks get a chance to clean up the associated
resources when a query is canceled.
65 jobs for !5884 with 3168-3-separate-all-recursions in 25 minutes and 26 seconds (queued for 6 minutes and 13 seconds)
detached
Name Stage Failure
failed
system:gcc:tumbleweed:amd64 System
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 1475 files

Uploading artifacts as "archive" to coordinator... 201 Created
id=2517267 responseStatus=201 Created token=BQerHpXq
Uploading artifacts...
junit.xml: found 1 matching files and directories

Uploading artifacts as "junit" to coordinator... 201 Created
id=2517267 responseStatus=201 Created token=BQerHpXq
Cleaning up project directory and file based variables
ERROR: Job failed: exit code 1

failed
system:clang:freebsd13:amd64 System
Preparing the "custom" executor
Using Custom executor...
Formatting '/home/gitlab-runner/runner-2517276.qcow2', fmt=qcow2 size=5368709120 backing_file=/home/gitlab-runner/qcow2/freebsd-13.0-x86_64-c5271bd6d96d.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16
Domain runner-2517276 defined from /home/gitlab-runner/runner-2517276.xml

Domain runner-2517276 started

VM boot timed out
ERROR: Job failed: exit status 1

failed
system:clang:freebsd12:amd64 System
Runtime platform                                    arch=amd64 os=freebsd pid=25345 revision=5316d4ac version=14.6.0
untracked: found 1765 files

Uploading artifacts as "archive" to coordinator... ok
id=2517275 responseStatus=201 Created token=FNHtszGX
Uploading artifacts...
Runtime platform
arch=amd64 os=freebsd pid=25348 revision=5316d4ac version=14.6.0
junit.xml: found 1 matching files and directories

Uploading artifacts as "junit" to coordinator... ok
id=2517275 responseStatus=201 Created token=FNHtszGX
Cleaning up project directory and file based variables
ERROR: Job failed: exit status 1