logd: fix kernel logline stutter

- look for cases where one log line contains two without a newline.
- rare condition, occurs when a printk does not have
  a terminating newline under certain race conditions.
- the newline may be performed broken up as a second call
- the timestamps can be reversed (showing the race effects).
- driver(s) should really have the newline in there log messages.

Change-Id: Ibfb56b32047da3d6513db059ca6edad0f0105168
diff --git a/logd/main.cpp b/logd/main.cpp
index 6db819e..805cbe6 100644
--- a/logd/main.cpp
+++ b/logd/main.cpp
@@ -417,8 +417,8 @@
                 kl->synchronize(buf);
             }
 
-            for (char *ptr, *tok = buf;
-                 (rc >= 0) && ((tok = strtok_r(tok, "\r\n", &ptr)));
+            for (char *ptr = NULL, *tok = buf;
+                 (rc >= 0) && ((tok = log_strtok_r(tok, &ptr)));
                  tok = NULL) {
                 if (al) {
                     rc = al->log(tok);