Fix invalid pointer problem for some queued connection events.