Fix handling of dynamically created timer events

This commit fixes the issue where alarm() is called immediately after a
newly-created event is added even if its time has not yet arrived.