netifd: fix a segfault and improve ipip6 tunnel setup