iio: Fix error handling in iio_trigger_attach_poll_func