kr_ranked_rrarray*: avoid duplicate RRsets on wire
Fixes https://gitlab.labs.nic.cz/knot/resolver/issues/198. We can't let multiple "matching RRsets" to the wire, and we can't just merge the sets from multiple queries either. The only way is to choose either of the sets and put it on the wire. ATM the last one wins.
Common ocurrence of the bug: if www.example.cz was a CNAME for example.cz and we ask for a non-existent type, we would get the SOA record twice in the final answer.
A few related changes:
- don't just assert, also return error code if -DNDEBUG
- kr_ranked_rrarray_set_wire: don't do full-content comparison anymore; see the first paragraph in this commit message for the reasons
- minor refactoring of that code, more comments, etc.
Edited by Vladimír Čunát