networkd: fix NULL pointer deref