SPARK-1767: Prefer HDFS-cached replicas when scheduling data-local tasks

This change reorders the replicas returned by
HadoopRDD#getPreferredLocations so that replicas cached by HDFS are at
the start of the list.  This requires Hadoop 2.5 or higher; previous
versions of Hadoop do not expose the information needed to determine
whether a replica is cached.
the way this is factored exposes a bunch of stuff at `private[spark]` visibility that is really specific to the internals of `HadoopRDD`. What about just adding a single static utility function in `HadoopRDD`:

```
/*** Return a correctly formatted set of location strings for a HadoopPartition. */
private[spark] def getLocationPreferences(partition: HadoopPartition): Seq[String] {
}
```