aiGetMaterialString is used to get string properties in general; the pKey is the name of the property that we want to retrive, which in this case should be: "$tex.file" .
AI_MATKEY_COLOR_DIFFUSE is not just the pKey parameter, it's the macro:
#define AI_MATKEY_COLOR_DIFFUSE "$clr.diffuse", 0, 0
Which refers to the wrong property and expands to fill the pKey , type , and index parameters of the function
Try using this:
aiGetMaterialString(material,
"$tex.file",
aiTextureType_DIFFUSE,
0,
path);
or this (notice the AI_MATKEY_TEXTURE macro):
aiGetMaterialString(material,
AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE, 0),
path);
where AI_MATKEY_TEXTURE(type, index) expands to "$tex.file", type, index
Also, regarding aiGetMaterialTexture, understand that it internally calls
aiGetMaterialString(mat, AI_MATKEY_TEXTURE(type, index), path)
to retrive the path to the texture, and it's used to get much more information about the texture than just the path