test_linkedlists: Fix memory leak