Fix null dereference when a SDL key or mouse has no window ID. The event is simply not dispatched in this case.