Update iFSM.js

Patch on the (previously bad) reinitialisation of the iteration count on events when changing of state