valgrind: apply 10.9 patch and cleanup.

Fixes #26061.