valgrind: apply Snow Leoapard patch

Closes #27289.