Fix a deadlock at test shutdown.
The test thread holds the network lock for too long and blocks the
network thread. The network thread indirectly holds a reference to
the raft instance, causing the latter to block on kill(), which
blocks the test thread.
This is Github issue #1.