luci-base: fix host validation function