Merge r1611126 from trunk. YARN-2264. Fixed a race condition in DrainDispatcher which may cause random test failures. Contributed by Li Lu