YARN-2432. RMStateStore should process the pending events before close. Contributed by Varun Saxena