PDI-9088 - Prioritize streams step causing null pointer exception downstream

Fix based on Frank Hilgendorf patch proposal.
Junit tests added.