Prefer mmap()ed consensus files over cached_dir_t entries.

Cached_dir_t is a somewhat "legacy" kind of storage when used for
consensus documents, and it appears that there are cases when
changing our settings causes us to stop updating those entries.

This can cause trouble, as @arma found out in #40375, where he
changed his settings around, and consensus diff application got
messed up: consensus diffs were being _requested_ based on the
latest consensus, but were being (incorrectly) applied to a
consensus that was no longer the latest one.

This patch is a minimal fix for backporting purposes: it has Tor do
the same search when applying consensus diffs as we use to request
them.  This should be sufficient for correct behavior.

There's a similar case in GETINFO handling; I've fixed that too.

Fixes #40375; bugfix on 0.3.1.1-alpha.
9 jobs for bug40375_045_v2 in 15 minutes and 54 seconds (queued for 4 seconds)
latest
Status Job ID Name Coverage
  Test
passed #21970
debian-disable-dirauth

00:05:43

passed #21971
debian-disable-relay

00:05:54

passed #21966
debian-distcheck

00:08:03

passed #21967
debian-docs

00:03:09

passed #21965
debian-hardened

00:08:08

failed #21968
debian-integration

00:14:25

passed #21964
debian-minimal

00:06:40

passed #21972
debian-nss

00:06:06

passed #21969
debian-tracing

00:08:28

 
Name Stage Failure
failed
debian-integration Test
05/26/2021 17:23:36 [NOTICE] Beginning test test.integ.process.TestProcess
05/26/2021 17:23:36 [NOTICE] Finished test test.integ.process.TestProcess
FATAL ERROR: Failed tests: stem
Uploading artifacts for failed job
Uploading artifacts...
artifacts/: found 2 matching files and directories

Uploading artifacts as "archive" to coordinator... ok
id=21968 responseStatus=201 Created token=sbTsLs9J
Cleaning up file based variables
ERROR: Job failed: exit code 1