Replace unwind-protect with shadowing let.