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.
Instead of having a separate `fromString` - can you just make the normal `apply()` pattern mach on this (see `BlockId.scala` again for inspiration)? It is a bit awkward to have this separate `apply` in the case where you have an executor ID... longer term we should probably refactor that so it has a string tag similar and operates in the same way as HDFS cached task location.