Fixed the ContenderDetectorShutdownNetwork test flakiness.

From: Jiang Yan Xu <yan@jxu.me>
Review: https://reviews.apache.org/r/15845