Improve the Linux implementation of getGateway().

Changes:
 * Properly return errors if the family is not AF_INET when looking at
   the returned table entries.
 * Manually parse RtMsg, and return IP + Masks for the
   source/destination networks, instead of just IPs.

The old code worked, but was kind of nasty, this should be much more
readable and serve as an example on how to do this correctly for future
generations.