A common pattern to acquire a resource, perform some action on it and then run a finalizer, regardless of the outcome of the action