Avoid missing identical lines during sanitization of logs

Webstats lines should be put out according to their count.

I'll post a test demonstrating this bug and its patch when there is a task number.