v.21.4Bug Fixes

Fix Crashes in Aggregate Functions with Distinct During Two-Level Aggregation

Fix possible crashes in aggregate functions with combinator Distinct, while using two-level aggregation. This is a follow-up fix of #18365 . Can only reproduced in production env. #21818 (Amos Bird).