http: use resolve_sockaddr so that “localhost” can come from /etc/hosts

Before, the configured DNS server needed to provide a record for
localhost, which many don’t do (OpenWrt does, but other popular
embedded devices don’t).
Bugfix: Properly encode UTF-8 in config parts that get passed to plugins (Thanks florianjacob)

fixes #19