Fixed a flaky test: SlaveTest.TerminatingSlaveDoesNotReregister.

Review: https://reviews.apache.org/r/22472