scripting: fix crash in StateMachine when doing global transitions.

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