shards: cache ranked slice
shards: cache ranked slice

On a search request we construct and sort a slice of all shards to
search. This change will cache the slice. We do the caching on the read path
to avoid holding the exclusive lock for a long time when we do writes to the
shard map.

The use of a "rankedVersion" is a bit fiddly. Alternatively we could look
making the replace call a batch version to amortize the cost of creating the
ranked slice.

Change-Id: I5272dbb75a4becebb8aa8727d8459d0666cb9bf9

google/zoekt,google/zoekt