ui_logwindow_add(): Correctly handle \r, \r\n and \n in log messages

Some bots/clients only send '\r', no doubt there will be some using
'\r\n', too. This new code handles all three cases correctly.
(In case you're wondering, '\n\r' is considered equivalent to two
newlines)