Portability fix for formatting IPv6 reverse names

Still kinda ugly, but this version should build on Solaris and other OSes using !glibc.