iio_get_trigger(): Set trigger to NULL if no trigger is assigned

Instead of leaving the trigger uninitialized and returning an error set trigger
to NULL and return success if currently no trigger is assigned.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Add workaround for kernel bug for shared attributes on channels with extended names

Some older versions of the kernel do not handle shared attributes on channels
with extended names correctly. Add a workaround for detecting and correcting
these attributes.

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