change how lines are printed in run_command

It looks like we were getting a deadlock when trying to read the log lines from the subcommands. I think this was caused by how we were reading the lines.