valgrind: unflake cache purging test

Fixes #569.