(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

{
    
    if (client_revision > 0)
        block.info.write(ostr);
    block.checkNumberOfRows();
    
    size_t columns = block.columns();
    size_t rows = block.rows();
    writeVarUInt(columns, ostr);
    writeVarUInt(rows, ostr);
    /** The index has the same structure as the data stream.
      * But instead of column values, it contains a mark that points to the location in the data file where this part of the column is located.
      */
    if (index_ostr)
    {
        writeVarUInt(columns, *index_ostr);
        writeVarUInt(rows, *index_ostr);
    }
    for (size_t i = 0; i < columns; ++i)
    {
        
        MarkInCompressedFile mark;
        if (index_ostr)
        {
            ostr_concrete->next();  
            mark.offset_in_compressed_file = initial_size_of_file + ostr_concrete->getCompressedBytes();
            mark.offset_in_decompressed_block = ostr_concrete->getRemainingBytes();
        }
        ColumnWithTypeAndName column = block.safeGetByPosition(i);