fixes #686, with regression test
better solution to #686 — despite #319, tm_log is ideally for raw data rather than strings
Merge #687 r=@natevw: Convert stdout/stderr chunks to string (if not already) before logging

It is not proper to pass a buffer directly into tm_log, this fixes a segfault when piping (or simply writing buffers) to `process.stdout`.