remove staging dir when app quiting for yarn-cluster mode

In yarn-cluster, the driver is actually running as 'yarn' user. When
posting jobs from other users, we need give stagingDir a full path, so
the driver could remove the correct directory if needed.
Since this function already takes the stagingDir as a parameter and since we have to construct this now in 2 places (here and in prepareLocalResources) it would be better to pull this up higher and construct it once and pass it in.