YARN-2387. Resource Manager crashes with NPE due to lack of synchronization. Contributed by Mit Desai