[SPARK-2814][SQL] HiveThriftServer2 throws NPE when executing native commands

JIRA issue: [SPARK-2814](https://issues.apache.org/jira/browse/SPARK-2814)