wave5: Add locking to state switching
T42971
Implemented a spinlock protection for state switches, the fluster test results remain the same. Hang at RAP_B_Bossen_2. Opted for spinlock as the operation only requires minimal operations and thus the time spinning should be very minimal and locking mechanism is the simplest.