[udp] Better fix for -ENETUNREACH
This fix for the ENETUNREACH problem works better than the last one
in that it also works with Linux kernels > 5.0.0 (which return
-ENETUNREACH) if an interfaces is brought down, and also on FreeBSD
which returns ENETDOWN.