Sync with upstream

Signed-off-by: Robin Getz <robin.getz@analog.com>
Make sure iio_spin_button_int_init_from_builder can be invoked as
iio_spin_button_int_init, as the others can be.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Fix warning on target during startup

Signed-off-by: Robin Getz <robin.getz@analog.com>
Fix issues pointed out by valgrind

Signed-off-by: Robin Getz <robin.getz@analog.com>
Add and connect the inih library

Signed-off-by: Robin Getz <robin.getz@analog.com>
Give mutex a more discriptive name, and unlock it a few more places, so
we don't hold the lock when we stop things.
Fix most of the pthread issues. Add proper Rx Calibration, and save/load
to/from files.

Signed-off-by: Robin Getz <robin.getz@analog.com>