tablet_server: use atomic instructions to access the flag set by tests
tablet_server: use atomic instructions to access the flag set by tests

Fixes a TSAN error:

  Read of size 1 at 0x7d480000bc51 by thread T25:
    #0 kudu::tserver::TabletServer::fail_heartbeats_for_tests() const /home/todd/git/kudu/src/tserver/tablet_server.h:72 (exe+0x00000050ff5f)
    #1 kudu::tserver::Heartbeater::Thread::DoHeartbeat() /home/todd/git/kudu/src/tserver/heartbeater.cc:210 (exe+0x00000050cafe)
    #2 kudu::tserver::Heartbeater::Thread::RunThread() /home/todd/git/kudu/src/tserver/heartbeater.cc:276 (exe+0x00000050ebf3)
    #3 boost::_mfi::mf0<void, kudu::tserver::Heartbeater::Thread>::operator()(kudu::tserver::Heartbeater::Thread*) const /usr/include/boost/bind/mem_fn_template.hpp:49 (
    #4 void boost::_bi::list1<boost::_bi::value<kudu::tserver::Heartbeater::Thread*> >::operator()<boost::_mfi::mf0<void, kudu::tserver::Heartbeater::Thread>, boost::_bi
    #5 boost::_bi::bind_t<void, boost::_mfi::mf0<void, kudu::tserver::Heartbeater::Thread>, boost::_bi::list1<boost::_bi::value<kudu::tserver::Heartbeater::Thread*> > >:
    #6 kudu::thread_util_internal::ThreadStarter<boost::_bi::bind_t<void, boost::_mfi::mf0<void, kudu::tserver::Heartbeater::Thread>, boost::_bi::list1<boost::_bi::value
    #7 boost::detail::thread_data<kudu::thread_util_internal::ThreadStarter<boost::_bi::bind_t<void, boost::_mfi::mf0<void, kudu::tserver::Heartbeater::Thread>, boost::_
    #8 boost::this_thread::interruption_requested() ??:0 (libboost_thread.so.1.54.0+0x00000000ba49)

  Previous write of size 1 at 0x7d480000bc51 by main thread:
    #0 kudu::tserver::TabletServer::set_fail_heartbeats_for_tests(bool) /home/todd/git/kudu/src/tserver/tablet_server.h:68 (exe+0x0000004a1d81)
    #1 kudu::tserver::MiniTabletServer::FailHeartbeats() /home/todd/git/kudu/src/tserver/mini_tablet_server.cc:100 (exe+0x0000004a1006)
    #2 kudu::tserver::TsTabletManagerTest::SetUp() /home/todd/git/kudu/src/tserver/ts_tablet_manager-test.cc:47 (exe+0x000000481b27)
    #3 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ??:0 (exe+0x000000e2c4
    #4 __libc_start_main /build/buildd/eglibc-2.17/csu/libc-start.c:260 (libc.so.6+0x000000021de4)

Change-Id: If7d33964e89eccc9ef8a94fdd395ec7df56699ce
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2055
Tested-by: jenkins
Reviewed-by: Michael Percy <e07a1fd797b473a9c849e618aa2ce06d8055760b@cloudera.com>

andrwng/kudu,andrwng/kudu,helifu/kudu,InspurUSA/kudu,helifu/kudu,EvilMcJerkface/kudu,andrwng/kudu,andrwng/kudu,InspurUSA/kudu,cloudera/kudu,helifu/kudu,andrwng/kudu,helifu/kudu,EvilMcJerkface/kudu,EvilMcJerkface/kudu,InspurUSA/kudu,andrwng/kudu,InspurUSA/kudu,InspurUSA/kudu,cloudera/kudu,andrwng/kudu,cloudera/kudu,cloudera/kudu,InspurUSA/kudu,cloudera/kudu,helifu/kudu,cloudera/kudu,cloudera/kudu,cloudera/kudu,EvilMcJerkface/kudu,andrwng/kudu,EvilMcJerkface/kudu,InspurUSA/kudu,helifu/kudu,EvilMcJerkface/kudu,helifu/kudu,EvilMcJerkface/kudu,EvilMcJerkface/kudu,helifu/kudu,EvilMcJerkface/kudu,InspurUSA/kudu,cloudera/kudu,andrwng/kudu,InspurUSA/kudu,helifu/kudu