discovery: limit 'all local heads known remotely' to real 'all' (issue4438)

3ef893520a85 made it possible that the initial head check didn't include all
heads. If that is the case, don't use the early exit just because this random
sample happened to be 'all known'.

Note: the randomness in the discovery protocol can make this problem hard to
reproduce.

--HG--
branch : stable
extra : rebase_source : 34e89b7e74cb89d95e409300cc8be68c770dce8f
discovery: indices between sample and yesno must match (issue4438)

3ef893520a85 changed 'sample' from a list to a set. The iteration order is thus
undefined and the yesno indices are not stable.

To solve this, repeat the listification and comment from elsewhere in the code.

Note: the randomness in the discovery protocol can make this problem hard to
reproduce.

--HG--
branch : stable
extra : rebase_source : a8b2c287b7ba4c623c78caf3147e0b50ad25a17d