Avoid holding the state lock while notifying
Avoid holding the state lock while notifying

To avoid dead lock where a notifier will callback
into the engine to perform a further state transition
make sure we activate the state change notifiation
after locking and not during it.

Fixes bug 1301091

Change-Id: Ic81e15150e44d36489757372db32adfb5440feb4

junneyang/taskflow,pombredanne/taskflow-1,openstack/taskflow,pombredanne/taskflow-1,junneyang/taskflow,jimbobhickville/taskflow,jimbobhickville/taskflow,openstack/taskflow