Fix segfault with mixed IPv4/IPv6 nameservers

Fixes bug #1154432