Fix temporary file creation and cleanup during testing

Try to find a suitable location when running under Buck by looking
for buck-out/tmp. If Maven ever invoked with a JAR this would be
$project/target/tmp.

Multiple hooks may be extracted per execution run, so there can
be multiple files to clean up after the test.

Change-Id: I5e5e506fe5070dc6c517cb679023f7a699d0cb62
7 files changed