Implement traversity_core_get_local_ips for UNIX systems
This is basically an import from the original code in purple2 with some clean
ups.
Testing Done:
ran traversity-test on Debian Bookworm AMD64, OpenBSD 7.1 64bit, Freebsd 13.1 32bit, macOS Monterey 64bit, and Haiku OS (not sure version/arch).
I also force the ioctl path on all of them, Haiku only uses the ioctl path, but OpenBSD does not support the ioctl path.
Reviewed at https://reviews.imfreedom.org/r/1963/