windows, unix: getnameinfo implementation for #852

Pass flag arguments to getnameinfo.