Fix race condition with updating teamStore and g.team*Cache variables.