travis: Refactor {valgrind,asan}_check functions

Put all logic into the `check_logs` function and use the `find` command instead
of legacy shell hacks to handle errors when globbing files.