IMPALA-7476: Use context to limit scope of StatestoreSubscriber
IMPALA-7476: Use context to limit scope of StatestoreSubscriber

StatestoreSubscribers are outliving the end of
test_statestore.py, causing continued interaction with
the statestored with a lot of log spew in statestored.INFO
and the main test log.

This change converts StatestoreSubscriber to use a
Python context manager. It updates all the tests to
use this context manager. This ensures that the
StatestoreSubscriber runs kill() at the end of
each test.

There is also a circular reference between
StatestoreSubscriber and KillableThreadedServer that
prevents cleanup. This resolves the circular reference
by nulling out some variables on
KillableThreadedServer::shutdown().

Testing:
 - Verified log spew is gone
 - StatestoreSubscriber::__del__ is called for 16 out
   of 17 tests (exception: test_hung_heartbeat) where
   before it was called for none

Change-Id: Ie71fac6095cd94343f68b586238aed410ebbca39
Reviewed-on: http://gerrit.cloudera.org:8080/11326
Reviewed-by: Joe McDonnell <2f04924382c6a21f96a9a4f8cbedc35ff4599584@cloudera.com>
Tested-by: Impala Public Jenkins <039b6b20426ff68ebe492b3021890d8c8fd010c9@cloudera.com>

cloudera/Impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,cloudera/Impala