dnsdist: Faster cache-lookups for DNS over HTTPS queries
For DoH queries we do two cache lookups:
- a first one for responses received over UDP, that can be truncated,
which we do not want here as the client likely would not what to do
with that
- then on a miss, a second one for responses received over TCP
We do not want the first lookup to override the initial query in
case of a hit for a TC=1 response, so we used to do a copy of the
query (allocation + copy).
This code move the TC=1 check to the cache itself so we do not have
to do that copy, speeding things up.