Fix return values attribute writes

This patchset makes a bunch of functions compliant with their interface as defined in iio.h. Those functions are supposed to return 0 on success, while their current implementation returns the number of bytes written instead.

The patch was verified against a previously failing scenario which uses iio_device_attr_write_longlong() only, but the same resolution should apply cleanly to all other affected functions.

Patches to different families of functions has been kept separate for clarity. Feel free to squash them down if this is more convenient for the repository commit policy.