move serious work out of destructor; revert some scoped_resource cosmetics