libpkgconf: pkg: pkg_get_parent_dir(): use caller-supplied buffer instead of a static buffer to make reentrant