Network backend: properly handle context initialization failure

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Allow inclusion of iio.h by C++ code

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>