generate a finally block for popping a thread-binding.