Issue #115: ensure network threads are terminated when they are no longer active