Fix gpio and irq wakeup irq handling.