trim bug fix: Also factor end states into offset array alloc size.
trim bug fix: Also factor end states into offset array alloc size.

theft found a potential buffer overrun when trimming the FSM
produced by the regex "^(aaaaaeaaaabaa)?$". This regex led to an
FSM where the start state, 13, was also an end, but the code in
`fsm_trim` that determines how large the offset array should be
only checked for the largest state with an edge to it -- since
there was no edge to the start state, but it was reachable from
the start, it was still live during trimming, and since it was
an end state it was added to the queue for states with a path
to an end state (using the reverse index). When popped from the
queue, the state ID was greater than the offset array length, so
the bounds check assert failed.

This is fixed by basing the offset array allocation size on
the largest to-edge or end ID, whichever is greater.

katef/libfsm,katef/libfsm,katef/libfsm,katef/libfsm,katef/libfsm