lib/cache: simplify logic for qry->flags.CACHE_TRIED
As a side effect, this solves an issue which could be seen
during resolver startup where the trust anchor update would fail.
[taupd ] active refresh failed for . with rcode: 2
The cause is that for queries started with .flags.NO_CACHE,
we'd skip the section setting .flags.CACHE_TRIED, and consequently
kr_rule_local_data_answer() would get run more often than expected.
The new logic should be also much simpler to follow.
We always apply cache (and policy) just once per kr_query.