test/dns: cleanup test_bufferevent_connect_hostname() (cherry picked from commit 623ef3ccdc0aafac7ae77a723cbad6d552ff9a01)