YARN-2946. Fixed potential deadlock in RMStateStore. Contributed by Rohith Sharmaks