Modules: fix clearTimeout() of a timer from its own callback
Previously, the timer event was removed from the pending events after
its callback was called. When the callback called clearTimeout() for
its own timer, the event was removed twice, which corrupted the
events tree. In QuickJS, the timer function and arguments were also
freed while the function was still running, and then freed again.
Now, the timer event is removed from the pending events before the
callback is called, and its data is freed after the callback returns.
The issue was introduced in
9de30135 (0.8.3).