=str #16272 splitWhen should drop reference when done with substream

The completeSubstreamOutput is used to not early complete the stream,
where as invalidating would shutdown the stream too early (and elements
wouldn't be emitted as expected).

Please review @drewhk @patriknw 
cc @jrudolph 
What's happening to the formatting here?