get_interface_address6() fixes

piebeer noticed some problems with get_interface_address6() and provided a patch:

connect's third argument should be dependent on address family, otherwise connect might return einval. This apparently happened in legacy/trac#599 (moved) and legacy/trac#1141 (moved) too.

While looking at that, I noticed another issue:

the port is not set correctly for both families. Danieldg provided review and assistance for this too.