sync/atomic: fix data races in tests Fixes issue 8389.
sync/atomic: fix data races in tests
Fixes issue 8389.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://codereview.appspot.com/111320044

bryanxu/go-zh,d0f/go-zh,sanjosh/sanjos100-tipc,webfd/go-zh,bryanxu/go-zh,sanjosh/sanjos100-tipc,bryanxu/go-zh,d0f/go-zh,d0f/go-zh,d0f/go-zh,d0f/go-zh,bryanxu/go-zh,webfd/go-zh,d0f/go-zh,bryanxu/go-zh,sanjosh/sanjos100-tipc,sanjosh/sanjos100-tipc,sanjosh/sanjos100-tipc,webfd/go-zh,bryanxu/go-zh,webfd/go-zh,sanjosh/sanjos100-tipc,webfd/go-zh,d0f/go-zh,bryanxu/go-zh,sanjosh/sanjos100-tipc,webfd/go-zh,webfd/go-zh,bryanxu/go-zh,sanjosh/sanjos100-tipc,webfd/go-zh,d0f/go-zh