[SPARK-2752]spark sql cli should not exit when exception

Spark sql cli now will exit directly when we input a bad sql, fix it by catching the exception and print the error~
Keep a newline at the end of the file.  Run `sbt/sbt scalastyle` to check style guideline locally.