beam/examples/beamsh: simplify code by using sendWPipe utility