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`.