Add test to expose Sample data race
Fix data race in Sample.Count() method