[SPARK-2598] RangePartitioner's binary search does not use the given Ordering

We should fix this in branch-1.0 as well.

Author: Reynold Xin <rxin@apache.org>

Closes #1500 from rxin/rangePartitioner and squashes the following commits:

c0a94f5 [Reynold Xin] [SPARK-2598] RangePartitioner's binary search does not use the given Ordering.

(cherry picked from commit fa51b0fb5bee95a402c7b7f13dcf0b46cf5bb429)
Signed-off-by: Reynold Xin <rxin@apache.org>