Handle `to_socket_addrs` returning an empty iter.
Handle `to_socket_addrs` returning an empty iter.

According to https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html#tymethod.to_socket_addrs
it is possible for `to_socket_addrs()` to return an `Ok` variant with a
zero sized iterator. This case is now handled.

Additionally a test for invalid socket addr values has been added.

Signed-off-by: Andrew Hobden <02e0a999c50b1f88df7a8f5a04e1b76b35ea6a88@hoverbear.org>

habitat-sh/habitat,habitat-sh/habitat,nathenharvey/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,georgemarshall/habitat,georgemarshall/habitat,habitat-sh/habitat,georgemarshall/habitat,georgemarshall/habitat,rsertelon/habitat,georgemarshall/habitat,georgemarshall/habitat,habitat-sh/habitat,nathenharvey/habitat,habitat-sh/habitat,georgemarshall/habitat,rsertelon/habitat,nathenharvey/habitat,rsertelon/habitat,georgemarshall/habitat,rsertelon/habitat,habitat-sh/habitat,nathenharvey/habitat,nathenharvey/habitat,habitat-sh/habitat,nathenharvey/habitat,rsertelon/habitat