[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.