IMPALA-2804: prevent destroying Thrift server before worker threads complete
IMPALA-2804: prevent destroying Thrift server before worker threads complete

Problem: session-expiry-test creates an in-process Impala service,
including a TThreadedServer backend server, against which it opens
sessions. When the test ends, both the client objects and server are
simultaneously destroyed, causing the sessions to be closed while the
server is being destroyed. Sometimes the server is destroyed before
the session close threads can complete, causing the ASAN failure.

Solution: Ideally we would wait for the sessions to be closed before
destroying the server. Unfortunately, I could not find a way to do
this, even though thrift servers expose a stop() method that looks
like it tries to join any running task threads. I tried building
against thrift 0.9.3 (the latest release), which modifies this code,
but stopping the server still has no visible effect.

Instead, as a workaround for now, I put a one-second between closing
the sessions and destroying the server, which fixes the problem
locally.

Change-Id: Ifd326e35ec56a3956ffab3f6bf6787d9fc116aa4
Reviewed-on: http://gerrit.cloudera.org:8080/1700
Reviewed-by: Skye Wanderman-Milne <6d4b168ab637b0a20cc9dbf96abb2537f372f946@cloudera.com>
Tested-by: Skye Wanderman-Milne <6d4b168ab637b0a20cc9dbf96abb2537f372f946@cloudera.com>

ibmsoe/ImpalaPPC,ibmsoe/ImpalaPPC,ibmsoe/ImpalaPPC,ibmsoe/ImpalaPPC,ibmsoe/ImpalaPPC,ibmsoe/ImpalaPPC,ibmsoe/ImpalaPPC