This was unsafe as g_pkvd is pointed to a stack variable that is only valid while inside of pfn_keyvalue()