[SPARK-2485][SQL] Lock usage of hive client.