dns_disable_when_inactive_no_ns_test: fix order of freeing resources