Fix memory leak when cleaning up after kopsik structs