Avoid using of popen for bi-directional pipes.