Fix datarace in TestLongReadWrite