cmd_ok: only print to a child process if needed
cmd_ok: only print to a child process if needed

If the cmd_ok spec doesn't provide any input lines for the program,
don't print any.  If the program is not expecting input, it might
exit before the parent process can write.  In such a case, the
parent would receive a broken pipe signal.

To be helpful in case things go wrong, trap SIGPIPE and convert it
into a slightly more informative error message.

mndrix/clk