prevent another StringIndexOutOfBoundsException in Graph.toAscii

This was observed for deep graphs in jrudolph/sbt-dependency-graph#36.

See also https://github.com/jrudolph/sbt-dependency-graph/commit/0bcd2e03f49f6c7133e9ef9e40b95d40970e4a29 where this was fixed in sbt-dependency-graph's fork of this code.