Change static tests to generate .o and .h files into a per test

directory to avoid issues with one test linking in a different test's
.o files. This eliminates an error doing "make static_test" on a
non-clean directory.