to create the directory path first.
If we cannot open the cache directly, fall back to creating the
hierarchy first.
This avoids a call to glib's g_mkdir_with_parents() function which
would walk the complete path trying to create already existing
directories.
ok ajacoutot@