ENG-5087 fix test to avoid an obscure bug in valgrind itself