add unregisterAlarm()

- implement the cancel logic
- when the alarm needs reset, cancel the previous one