Revert "Libresolv closed after use"

This reverts commit 5eac5639e4ac2e1a6aaf00887b6f0e07c5dd11d5.