Segmentation fault in dns.c with mixed IPv4/IPv6 nameservers

If you have nameservers of both IPv4 and IPv6 address families enabled in /etc/resolv.conf, this causes mtr to segfault due to a null dereference in two places in dns.c. This patch should fix that.

This is [bug 1154432 on Launchpad](https://bugs.launchpad.net/mtr/+bug/1154432).