Fixes a potential EventEmitter memory leak with a custom timeout