iio: Add helper function for calculating scan index storage size