grid: avoid spurious empty lines in Popen() stdout/log