network: write_all():  Handle errors from network_send()
network: write_all():  Handle errors from network_send()

If network_send() fails we need to abort write_all(), otherwise it will get
stuck in a endless loop.

Fixes: 4e1b42cf4c67 ("network: Add helper function for sending/receiving data")
Signed-off-by: Lars-Peter Clausen <3318dc5ce3e4fb7c28a0b841b6801c884e1d0896@metafoo.de>

analogdevicesinc/libiio,analogdevicesinc/libiio,analogdevicesinc/libiio,analogdevicesinc/libiio