issue1573: make GFileDirName() handle the returned memory as documented.

gfiledirname is documented as returning a pointer to memory owned by the function.
This is again now the case.