[SPARK-4336] [SQL] support type auto detection from json string

This is for [comment](https://github.com/apache/spark/pull/3012#issuecomment-61222405) from @davies in #3012 
By this patch, we can detect TimestampType and DateType from a json string.
This function will be called against every string in json, so it should be very fast. It should fail fast in most cases if the s is not a time, the path in catch is extremely slow, see [1].

[1] http://stackoverflow.com/questions/299068/how-slow-are-java-exceptions