These are great examples. I knew that I preferred destructors over defer, but I could not explain why. You put it into words.
I think people have a bias against destructors because of C++, but they really are pretty nice. Speaking as a guy that uses C instead of C++, destructors are the one thing I would add to C.