YARN-2977. Fixed intermittent TestNMClient failure. (Contributed by Junping Du)