YARN-2938. Fixed new findbugs warnings in hadoop-yarn-resourcemanager and hadoop-yarn-applicationhistoryservice. Contributed by Varun Saxena.

(cherry picked from commit 241d3b3a50c6af92f023d8b2c24598f4813f4674)