Fix sorting from Select

Broken by 1dffda85b0a0bc2d417c0b8fd97dffb1202e33bd.

Fix in two ways:

* Close the input to the sorter when done loading.
* Change test on input lifecycle state to an error check, not a condition on outputting anything.

Requires a new test. This is an unusual combination of operators, because usually there is another operator, like Filter, in the way.