resolved: use reference counting for DnsQueryCandidate objects
Follow-up for
4ea8b443de. The logic that manages DnsQueryCandidate is rather
complicated: a calls to dns_query_complete() that wants to destroy a
DnsQueryCandidate can be nested inside a deep chain of calls. Using reference
counts seems like the simplest approach.
DnsSearchDomain already uses reference counting.
This patch effectively brings dns_query_candidate_go() to the state before
4ea8b443de, but wraps the iteration over DnsQueryCandidate.transactions in
dns_query_candidate_ref+dns_query_candidate_unref.
(cherry picked from commit
0e0fd08fc832b8f42e567d722d388eba086da5ff)
(cherry picked from commit
ab9f7e1a51005f12d3bac83b86716d9d33048eb7)