Retrieves a specific path segment by index.
The path segment at the specified index or null if not found.
The index of the path segment to retrieve.