fix crash when destroying a filter that has events pending in the event queue