[SPARK-2042] Prevent unnecessary shuffle triggered by take()

This PR implements `take()` on a `SchemaRDD` by inserting a logical limit that is followed by a `collect()`. This is also accompanied by adding a catalyst optimizer rule for collapsing adjacent limits. Doing so prevents an unnecessary shuffle that is sometimes triggered by `take()`.
Collapsing 2 limits may result in expressions like `Limit if ((10 < 5)) 10 else 5`, so we actually need a few runs of a subset of the constant folding suite (ideally `n+1` runs for `n` limits)