scripting: fix crash in StateMachine when doing global transitions.

Signed-off-by: Peter Soetens <peter@thesourceworks.com>
scripting: also allow global-to-global event transitions

Signed-off-by: Peter Soetens <peter@thesourceworks.com>