Fix to interrupt handling

Simulate the CPU's behavior of polling for interrupts during the first
cycle of a multi-cycle instruction by moving the interrupt check before
the state of the flag is actually changed for instructions that affect
that flag.