[delegate] Improve trampoline caching

Don't add new variables to the top level context.
Add it to the right switch clause and use a more descriptive name than h.