Fix handling of nil elements

At several points the output of exec_ifconfig() was simply used without being actually checked to contain anything, leading to some output like this:

    Could not retrieve ipaddress6: undefined method `scan' for nil:NilClass
    Could not retrieve macaddress: undefined method `each_line' for nil:NilClass
    Could not retrieve netmask: undefined method `split' for nil:NilClass

These commits add the required checks.