Minor fix to make Slave::detected() public for testing.

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