message: Fix data-race in ungrouped COUNT(DISTINCT): set event BEFORE scheduling tasks, otherwise if all tasks finish before the event is scheduled weird things happen
diff: @@ -477,6 +477,10 @@ public:
  void Schedule() override {
  auto &distinct_data = *gstate.distinct_data;
  + //! Now that all tables are combined, it's time to do the distinct aggregations
  + auto new_event = make_shared<DistinctAggregateFinalizeEvent>(op, gstate, *pipeline, client);
  + this->InsertEvent(move(new_event));
  +
  vector<unique_ptr<Task>> tasks;
  for (idx_t table_idx = 0; table_idx < distinct_data.radix_tables.size(); table_idx++) {
  distinct_data.radix_tables[table_idx]->ScheduleTasks(pipeline->executor, shared_from_this(),
  @@ -484,10 +488,6 @@ public:
  }
  D_ASSERT(!tasks.empty());
  SetTasks(move(tasks));
  -
  - //! Now that all tables are combined, it's time to do the distinct aggregations
  - auto new_event = make_shared<DistinctAggregateFinalizeEvent>(op, gstate, *pipeline, client);
  - this->InsertEvent(move(new_event));
  }
  };
  