[SPARK-3939][SQL] NPE caused by SessionState.out not set in thriftserver2

There would be an NPE caused by SessionState.out not set in thriftserver2.
Instead of duplicating this code, can we just change the line above to `SessionState.start(SparkSQLEnv.hiveContext.sessionState)`.  `out` and `err` would be initialized then.  I'm actually not sure why we are creating our own session state here at all instead of using the one provided by the context.