WIP: Fix possible data races

Witold Krecicki requested to merge wpk-fix-possible-data-races into main

Multiple data races found by TSAN, best reviewed commit by commit

Merge request reports