Reapply fix in r217988 (reverted in r217989) and remove the alternative fix committed in r217987.

This type isn't owned polymorphically (as demonstrated by making the
dtor protected and everything still compiling) so just address the
warning by protecting the base dtor and making the derived class final.