YARN-2785. Fixed intermittent TestContainerResourceUsage failure. Contributed by Varun Vasudev.

(cherry picked from commit 27715ec63bd77f1d31ee922b7daba85071da54ca)
Merge remote-tracking branch 'remotes/origin/branch-2' into branch-2