Add gateway devices

To avoid ping storms in non-home networks, if a gateway device is defined
lapdog will generate a ping storm only if a gateway is present.

The devices that appear on the ARP table will still be pinged until they
disappear from it.
ARP rescan

In case of missing gateway, perform the ARP rescan anyway. This will help
in reducing the number of pings, as devices disappear from the ARP table
after the host moved to a different network.
Check result of getpwnam()

Check that the pointer is non-null before trying to access it.