Fix graph rendering of staged and unstaged changes

The staged and unstaged changes was added using a stack allocated
`struct commit`. Since the commit ID was referenced from `struct graph`
via a pointer, the graph ID would change when both staged and unstaged
changes commits was added in the main view due to `graph->id` pointing
to an old stack allocated value. This would lead to the following graph:

    ● Staged changes
    ●─╯ Unstaged changes
    │ ● [master] [origin/master] [origin/HEAD] Minor code tidyup
    │ ● Add support for specifying custom prompt for %(prompt)
    │ ● Abandon the %(prompt) when the user escapes it

Fix the graph rendering by changing `graph->id` to be a buffer and copy
the commit ID to make it resilient to stack allocation.