Add scoped function

Add a function to handle the common enter-leave pattern.
In the case f throws, finally is executed and the exception is propagated to he next catch. It behave completely transparent. As if you would call f directly.