v.20.5Bug Fix

Fix Memory Leak in Aggregation with -State Functions

Fix memory leak when exception is thrown in the middle of aggregation with -State functions. This fixes #8995. #11496 (alexey-milovidov).