RemoteQueryExecutor::cancel() (that is called in another thread), steal
the fiber, and process any pending packets, to leave the connection in
the correct state (so that it can be reused for further queries).
However this requires processing pending packets, and this will update
the RemoteQueryExecutorReadContext::packet field, which can be read in
another thread by the RemoteQueryExecutor::read().
This was pretty tricky due to fibers, but AFAICS I understand this
correctly and this should fix the race.
Note, that if you will look at the logs from the #28854, you will see,
that all those data races was triggered after query cancellation.
Fixes: #28854
Refs: #18715
v2: fix daedlock in case of duplicated parts
v3: do not hold the mutex, since was_cancelled is atomic