Fix lots of unrelated data races

this is much nicer