iio: local: wrap duplicate device attributes code
iio: local: wrap duplicate device attributes code

The allocation of the device attributes is pretty similar. This change
groups all the realloc() code into a single routine.

Signed-off-by: Alexandru Ardelean <685557f6b7c225d86b536740313ed51b24843a58@analog.com>

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