fix trap_listener crash when call `close`