GWP-ASan: Delay use of random eviction

As of http://crrev.com/df5978bab08b4cf87b2139d53ed9b8af27ca2bb7 we use
random eviction to allocate slots/metadata; however, we use random
eviction even before all slots/metadata have been allocated leading to
the early reuse of slots/metadata. This is inefficient as it leads to an
unnecessary early loss of data. Change the allocation algorithm to use
all slots/metadata before using random eviction.

Bug: 956724, 939142
Change-Id: I6dcaecaf64f480ac8827db3d6f06f6a6cadfb441
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584986
Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
Auto-Submit: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654272}
2 files changed