Fix the ROOT_PDIR directory resolution on symlinked directories.