[event] use flag for periodicity
[event] allow the purge function to get rid of timedout timers instead of directly destroying them. This allows events to only be destroyed by the event code instead of having to call event_free