completion: simplify prefix path component handling during path completion