Handle carriage return in log payload.

Make Util.escape() strip carriage return from payload when followed by
newline, and replace with newline when not.