Fix GroupMessages preprocessor
Fix idempotency of the GroupMessagess preprocessor (introduced in
!2260 (merged)). Now it correctly matches lines containing \n
(such as after running on its own output).
Also, avoid adding extra new lines characters in grouped messages.