Fix initializing array from array_view; seems to have never worked.

(cherry picked from commit 72233f18636a3c5d17160271a32932e0b97a1b4d)
Revert "Disable internal pipe sorting for now"

This reverts commit d2ed9ee1dab0ce5fd2411461cd7a98b074910797.
Fix merge sorter using too much memory in internal reporting.

Checking if the number of items pushed is within the internal report
threshold is not sufficient: it might be necessary to resize the
internal item buffer to fit in the memory requirements for the
subsequent phases.

(cherry picked from commit 9b43f8152ee174250a6c58a9149e6430465e713c)
Use item upper bound information in merge sorter.