YARN-2624. Resource Localization fails on a cluster due to existing cache directories. Contributed by Anubhav Dhoot
(cherry picked from commit 29f520052e2b02f44979980e446acc0dccd96d54)