fix the getnameinfo()

tested with IPv4 and IPv6 on Windows and Linux.

Reported-by: Tomás Abad <tabadgp@gmail.com>