Modified flag restoring code for interrupts; simplified the syscall stack switch finder by using a DR api.