rtc: handle errors correctly in rtc_irq_set_state()