logd: klogd deal with nuls in dmesg

(cherry pick from commit 151beac76d372c5c1bd71e656a6cfbd177e36509)

Switch to using string and length in all transactions, treating
trailing nuls the same as spaces.

ToDo: change dumpstate (bugreport) to use logcat -b printable _regardless_

Bug: 23517551
Change-Id: I42162365e6bf8ed79d356e7b689a673902116fdb
5 files changed