I wonder if it's not possible to do something more clever than invasive code.

How about outputting all the coverage stuff in the fd 3 (1 is stdout, 2 is stderr) and then in the Travis script we can do:

`make test-agent-test COVERAGE=1 3>&1 1> /dev/null 2>&1`