tests: Fix memory leaks in test-classifier program.