I think <onexit> will be confusing: It's not run when you exit the
program but when you leave the current scope.
> <cleanup> and <unwind> aren't bad.
<cleanup>, <unwind>, <scoped> would all be fine for me, with
<unwind>/<scoped> slightly preferred – these two describe the mechanism
/ when stuff happens, not what happens.
"cleanup" is both slightly too wide (not all cleanup happens in <close>)
and slightly too narrow (not everything you might do in <close> is
strictly cleanup, you might also be generating a report / doing stats / …).
<close> is about as good as <cleanup> – acceptable but feels somewhat
imprecise.
At First I liked <scoped> too. But we are annotating the variables, non the values, and all the variables are already "Scoped". So probably <finalize> or <cleanup> is better. Or maybe <finalizer> since the variable is "Who finalize the value". I do not know if <cleaner> is a proper English word :)