lib: dns: Clean up allocated structure on error exit.