This is complicated by valgrind's limited options, and our desire not to run
valgrind twice (it's already the slowest part of the tests).
Ideally I'd like a different error code for each kind of error. I
could parse and pretty-print the XML output, but instead I just parse
the human-readable (which is fragile).