Fix issue with sending statechart events while state transitioning.

sendEvent had a typo which allowed events to be sent while in the middle of
a state transition. Fixing that revealed that now events sent during state
transitions would be queued but never sent (at least until another event
was sent).