Fixes a failure to add indirect branch targets to the lookup table on Windows, a regression due to commit 638fb106 (PR #4886).
Adds a regression test. Since small-enough pure performance tests on test VM's are difficult to keep non-flaky, we instead check the count of cache exits as a proxy for performance. We turn the total exit count into a release-build statistic, paying the cost of that one counter. (This stat should be useful for other purposes as well.) We add a workload with several separate calls (to avoid trace capture of one target) in a loop to the api.detach test as a convenient test for programmatically grabbing the stats and checking the resulting count.
Manually tested on the Botan library program from the original reported problem: the big slowdown disappears with this fix.
Fixes #5352 (closed)