Fix constness of array.d

Thanks to @aG0aep6G this works as far as I can see.
What if elements are immutable? Then things like  `arr[].filter(x > 0).array` degrade to const element.