Fix flush assertion with tsan
Fix flush assertion with tsan

Summary:
DBImpl's instance variables should only be accessed with mutex held. I moved an assert later to uphold this rule.

DBTest.LastWriteBufferDelay test was sporadically failing TSAN because it tried to flush around the same time the db was destroyed, so the variable was accessed simultaneously by two threads.
Closes https://github.com/facebook/rocksdb/pull/2471

Differential Revision: D5286857

Pulled By: ajkr

fbshipit-source-id: 435abd84efa601f667c254e320b0bb5a434b971f

SunguckLee/RocksDB,Andymic/rocksdb,Andymic/rocksdb,bbiao/rocksdb,Andymic/rocksdb,SunguckLee/RocksDB,Andymic/rocksdb,Andymic/rocksdb,Andymic/rocksdb,Andymic/rocksdb,SunguckLee/RocksDB,SunguckLee/RocksDB,bbiao/rocksdb,SunguckLee/RocksDB,bbiao/rocksdb,bbiao/rocksdb,SunguckLee/RocksDB,SunguckLee/RocksDB,bbiao/rocksdb,bbiao/rocksdb,bbiao/rocksdb,Andymic/rocksdb,SunguckLee/RocksDB,bbiao/rocksdb