If getaddrinfo() was called with AI_PASSIVE flag in hints,
returned address defaulted to SOCK_STREAM and IPPROTO_TCP.
Fixed so that SOCK_DGRAM leads to correct address type
that can be fed to bind() directly.
Same hard coding was visible when numerical IPv4 address string
was converted to binary. That is also fixed to respect hints now.
Also, added functionality to get IPv6 address, when hints contained
AF_INET6.
Fixes#30686
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>