StateMachine: Add SetState method

Sometimes it might be useful to have a method just for changing the state of
your state machine. This can be implemented easily by custom user-defined
SetState event, but having it as a method on StateMachine makes things easier.

Signed-off-by: Ondrej Kupka <ondra.cap@gmail.com>