magit-log-{oneline,long}-re: fix matching graph

There can be consecutive spaces within the graph, not only at its end.

Close #1077.