Order state changes are now tracked after all transitions, exactly like shipments and payment state transitions

Fixes #3850