[PDI-10936] Sort rows step never ends when using the new presorted data option and an empty stream

Commits are not squashed to split the fix into 3 logical parts: formatting, the fix itself, the unit test