SPARK-4228 SchemaRDD to JSON

Here's a simple fix for SchemaRDD to JSON.
Yeah, I think for user defined type it will just be

```scala
case (udt: UserDefinedType[_], v) => valWriter(udt.sqlType, v)