Ok, so figure out why iio_channel_attr_read_double() is taking so long, see if it does unneccesary things or if there is a different approach.We have ruled all this things out already. The shown high usage is ONLY caused by the read. Which you can simply check by deleting the setting line from the code and end up with no cpu difference.
Btw - if you comment out the read the conditional will always fail and the write will never happen either. Just checking that you considered this.
I think this is a very easy problem at this point. It's a simple process that you can debug. You can solve it immediately or prove its a hardware issue with judicious printf's.