Simplified benchmark pruning before analysis

Different ‘distribute analyses’ functions had essentially the same code
for pruning user-defined benchmarks (e.g. if they didn’t contain the
appropriate variable) before analysis ran - now in a single function.