Fix lots of unrelated data races