netifd: Fix SEG fault when device cannot be allocated