[1.7.x] Fixed #22959 -- Documented that class-based validators need to be deconstructible.

Backport of c692e37b63 from master