Fix line breaks in the log window in js when reaching MAX_LOG_LINES