CVE-2023-34967: mdssvc: add type checking to dalloc_value_for_key()