events: remove listener after timer is finished
Fixes the memory leak bug described in https://github.com/nodejs/node/issues/35990#issuecomment-722977913
It is very important to me to make the point that I believe we need to do https://github.com/nodejs/node/issues/35990#issue-737609854 if we want users not to run into this footfun.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines