local: Properly cleanup in local_open() when cyclic check fails
local: Properly cleanup in local_open() when cyclic check fails

When the cyclic check in local_open() fails the function needs to cleanup
instead of directly returning the error code. Otherwise the buffer will be
kept open and future opens on the same device and context fail.

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

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