Got rid of the ugly use of locks and consolidate synchronization between I/O thread and test thread using count down latches. I believe this makes the code much cleaner and easy to reason about.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208739770