use getifaddrs(3) instead of nosing in kernel memory

Use BSD libc API to fetch data about interface statistics instead of nosing in kernel memory. This API should work on all versions of FreeBSD/NetBSD/OpenBSD/Dragonfly.

This fixes compilation on FreeBSD 11, where kernel structures have changed and protects against future breakages. It also make the file much simplier.

Tested by:	Daniel Engberg <daniel.engberg.lists pyret.net>