[impala] Close the correct query history id