Fix graphing test

Allow `cylc graph` to print plain graph to standard output if the output
file argument is a `-`.

Use single `perl` command to parse graphing result, instead of 2 `sed`
and a `perl`.