[usb-moded] Validate ip in case bad values get fed in

It seems possible to feed bad ip's over dbus, which causes errors when setting
up the network and udhcpd. Also fixed a potential crash when updating the ip.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>