(you don't have to strictly follow this form)

**Describe the bug**
The following query leads to OOM if server was built with thread sanitizer.

```sql
SELECT range(65535) FROM system.one ARRAY JOIN range(65536) AS number

#include <Processors/Formats/Impl/ParallelFormattingOutputFormat.h>
#include <Common/setThreadName.h>
namespace DB
{
    void ParallelFormattingOutputFormat::finalize()
    {
        need_flush = true;
        IOutputFormat::finalized = true;
        
        
        addChunk(Chunk{}, ProcessingUnitType::FINALIZE,  false);
        collector_finished.wait();
        if (collector_thread.joinable())
            collector_thread.join();
        {
            std::unique_lock<std::mutex> lock(mutex);
            if (background_exception)
                std::rethrow_exception(background_exception);
        }
    }
    void ParallelFormattingOutputFormat::addChunk(Chunk chunk, ProcessingUnitType type, bool can_throw_exception)