dns tests: make sure we properly cleanup on ctor failure