graph: don't call string_copy_rev() on empty string

graph_expand() calls graph_insert_column() with the empty string as id,
which in turns leads to string_copy_rev() reading outside the allowed
memory area looking for whitespace.

To avoid this, don't call string_copy_rev() if we know the string is
empty anyway.

Signed-off-by: Romain Francoise <romain@orebokech.com>