Hack: fix test and dyntest to correctly use $TESTFLAGS

cc @tianon