Fix race in DCP Stream.itemReady

Race identified by ThreadSanitizer:

      Read of size 1 at 0x7d480000b458 by main thread (mutexes: write M18384, write M898, write M18351):
        #0 ActiveStream::addStats(void (*)(char const*, unsigned short, char const*, unsigned int, void const*), void const*) /home/vagrant/couchbase-server/ep-engine/src/dcp-stream.cc:386 (ep.so+0x0000000ff1a9)
        #1 DcpProducer::addStats(void (*)(char const*, unsigned short, char const*, unsigned int, void const*), void const*) /home/vagrant/couchbase-server/ep-engine/src/dcp-producer.cc:502 (ep.so+0x0000000efcd3)
        #2 ConnStatBuilder::operator()(SingleThreadedRCPtr<ConnHandler>&) /home/vagrant/couchbase-server/ep-engine/src/ep_engine.cc:3725 (ep.so+0x0000001ba97d)
        #3 ConnStatBuilder std::for_each<std::_List_iterator<SingleThreadedRCPtr<ConnHandler> >, ConnStatBuilder>(std::_List_iterator<SingleThreadedRCPtr<ConnHandler> >, std::_List_iterator<SingleThreadedRCPtr<ConnHandler> >, ConnStatBuilder) /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_algo.h:4417 (ep.so+0x0000001ba5b5)
        #4 void ConnMap::each_UNLOCKED<ConnStatBuilder>(ConnStatBuilder) /home/vagrant/couchbase-server/ep-engine/src/connmap.h:148 (ep.so+0x0000001ba519)
        #5 void ConnMap::each<ConnStatBuilder>(ConnStatBuilder) /home/vagrant/couchbase-server/ep-engine/src/connmap.h:140 (ep.so+0x0000001b2c4e)
        #6 EventuallyPersistentEngine::doDcpStats(void const*, void (*)(char const*, unsigned short, char const*, unsigned int, void const*)) /home/vagrant/couchbase-server/ep-engine/src/ep_engine.cc:3978 (ep.so+0x00000018928e)
        #7 EventuallyPersistentEngine::getStats(void const*, char const*, int, void (*)(char const*, unsigned short, char const*, unsigned int, void const*)) /home/vagrant/couchbase-server/ep-engine/src/ep_engine.cc:4384 (ep.so+0x00000018dc73)
        #8 EvpGetStats(engine_interface*, void const*, char const*, int, void (*)(char const*, unsigned short, char const*, unsigned int, void const*)) /home/vagrant/couchbase-server/ep-engine/src/ep_engine.cc:214 (ep.so+0x000000174062)
        #9 mock_get_stats /home/vagrant/couchbase-server/memcached/programs/engine_testapp/engine_testapp.c:196 (exe+0x0000000a741d)
        #10 get_int_stat(engine_interface*, engine_interface_v1*, char const*, char const*) /home/vagrant/couchbase-server/ep-engine/tests/ep_test_apis.cc:799 (ep_testsuite.so+0x0000000dae46)
        #11 dcp_stream(engine_interface*, engine_interface_v1*, char const*, void const*, unsigned short, unsigned int, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, int, int, int, int, int, bool) /home/vagrant/couchbase-server/ep-engine/tests/ep_testsuite.cc:3365 (ep_testsuite.so+0x0000000afc65)
        #12 test_dcp_producer_stream_req_disk(engine_interface*, engine_interface_v1*) /home/vagrant/couchbase-server/ep-engine/tests/ep_testsuite.cc:3596 (ep_testsuite.so+0x000000094ed0)
        #13 execute_test /home/vagrant/couchbase-server/memcached/programs/engine_testapp/engine_testapp.c:1055 (exe+0x0000000a3e83)
        #14 main /home/vagrant/couchbase-server/memcached/programs/engine_testapp/engine_testapp.c:1313 (exe+0x0000000a1d84)

      Previous write of size 1 at 0x7d480000b458 by thread T10 (mutexes: write M18363, write M18357):
        #0 ActiveStream::markDiskSnapshot(unsigned long, unsigned long) /home/vagrant/couchbase-server/ep-engine/src/dcp-stream.cc:202 (ep.so+0x0000000fd0c7)
        #1 DCPBackfill::create() /home/vagrant/couchbase-server/ep-engine/src/dcp-backfill.cc:138 (ep.so+0x0000000d057c)
        #2 DCPBackfill::run() /home/vagrant/couchbase-server/ep-engine/src/dcp-backfill.cc:95 (ep.so+0x0000000cfe3b)
        #3 BackfillManager::backfill() /home/vagrant/couchbase-server/ep-engine/src/dcp-backfill-manager.cc:171 (ep.so+0x0000000c778d)
        #4 BackfillManagerTask::run() /home/vagrant/couchbase-server/ep-engine/src/dcp-backfill-manager.cc:50 (ep.so+0x0000000c745a)
        #5 ExecutorThread::run() /home/vagrant/couchbase-server/ep-engine/src/executorthread.cc:110 (ep.so+0x00000021646f)
        #6 launch_executor_thread(void*) /home/vagrant/couchbase-server/ep-engine/src/executorthread.cc:34 (ep.so+0x00000021597a)
        #7 platform_thread_wrap /home/vagrant/couchbase-server/platform/src/cb_pthreads.c:19 (libplatform.so.0.1.0+0x0000000033f4)

Change-Id: I02cdf26c697f559a0afde91b377f1462c482349c
Reviewed-on: http://review.couchbase.org/43316
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>