Fix memory leak in dns module.

See #35.