fix n^2 performance issue in coalesce_streams preprocessor...
fix n^2 performance issue in coalesce_streams preprocessor
for n consecutive stream outputs, `\r` fix would be compiled n times,
and applied to each output (n-i) times.
- move pattern to module level
- apply replacement after coalescing outputs