YARN-2917. Fixed potential deadlock when system.exit is called in AsyncDispatcher. Contributed by Rohith Sharmaks
(cherry picked from commit 614b6afea450ebb897fbb2519c6f02e13b9bd12d)