tlsdate: Improve randomized IP selection

Improve randomization code for selecting a random IP for a host.
Make it choose the initial element randomly and iterate
sequentially from there. This should prevent it from selecting
the same (possibly bad) element several times in a row.

Bug: b/185961371
Test: Manually
Change-Id: I0eb8cf5c5d0cbf95f7040b50aef8dcaf513e0225
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/tlsdate/+/2859898
Tested-by: Michael Ershov <miersh@google.com>
Commit-Queue: Michael Ershov <miersh@google.com>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Pavol Marko <pmarko@chromium.org>
1 file changed