MAPREDUCE-5791. Merging change r1580996 from branch-2 to branch-2.4

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.4@1581003 13f79535-47bb-0310-9956-ffa450edef68
Merge r1581001 from trunk. YARN-1852. Fixed RMAppAttempt to not resend AttemptFailed/AttemptKilled events to already recovered Failed/Killed RMApps. Contributed by Rohith Sharmaks

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.4@1581004 13f79535-47bb-0310-9956-ffa450edef68