Running single test after test-rename doesn't work as expected

The reproducer is:

1. run single test
2. rename the test
3. run single test again

Result: test with old name is run.

The code forces refreshing imenu index.

I'm not sure imenu is the only possiblity to get current function, so others didn't have to run into this issue. If so, the refresh should be conditional.