Improve detection of network interface to monitor

Use /proc/net/route to try to find the interface corresponding to the
default route and use it. Only tested with IPv4.