Fix use after free in transactions
Fix use after free in transactions

In set_instructions_ready, calling set_instruction_ready may cause any
number of transactions to get applied, which removes them from the list
being iterated.  The iteration variables need to be adjusted
accordingly.

1ace/sway,taiyu-len/sway,SirCmpwn/sway,taiyu-len/sway,taiyu-len/sway,ascent12/sway,1ace/sway,1ace/sway,ascent12/sway,ascent12/sway