tests: fix leak in test.