We must hold on to every Python object owning C memory

Otherwise kv_array could be disposed of when it goes out of scope and cause a segfault later.