SPARK-821: Don't cache results when action run locally on driver

Caching the results of local actions (e.g., rdd.first()) causes the driver to
store entire partitions in its own memory, which may be highly constrained.
This patch simply makes the CacheManager avoid caching the result of all locally-run computations.
Add unit test and address comments
Reynold's second round of comments
Merge pull request #895 from ilikerps/821

SPARK-821: Don't cache results when action run locally on driver