[SPARK-1838] Spark on YARN throws exception for local mode

The following happens:
```
Caused by: java.lang.Exception: Yarn Local dirs can't be empty
	at org.apache.spark.executor.Executor.getYarnLocalDirs(Executor.scala:133)
	at org.apache.spark.executor.Executor.<init>(Executor.scala:68)
```

However, the environment variable `YARN_LOCAL_DIRS` isn't even used for local mode. This PR ensures that the exception is not thrown for this mode.

Tested on a YARN cluster.