[travis] Make valgrind check less error-prone.