batches: Address race condition for search result paths
Created by: eseliger
Closes https://github.com/sourcegraph/sourcegraph/issues/35070
This PR is just an investigation, not the actual solution to the problem. The diff contains a lot of noise.
Test plan
TBD