[sql]use SparkSQLEnv.stop() in ShutdownHook

Author: wangfei <wangfei1@huawei.com>

Closes #1852 from scwf/patch-3 and squashes the following commits:

ae28c29 [wangfei] use SparkSQLEnv.stop() in ShutdownHook

(cherry picked from commit e83fdcd421d132812411eb805565b76f087f1bc0)
Signed-off-by: Michael Armbrust <michael@databricks.com>