build: fix cleaning of test directories in contrib (and in t/perf)