network: Open sockets, pipes and files with close-on-exec
network: Open sockets, pipes and files with close-on-exec

We do not want to leak the library's internal file descriptors when an
application using the library spawns a new application using exec(). So
make sure that we create them with the close-on-exec flag set on systems
where it is available.

Signed-off-by: Lars-Peter Clausen <3318dc5ce3e4fb7c28a0b841b6801c884e1d0896@metafoo.de>

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