Handle the case ABC, AC in uniq_subpaths.

Before this change, such a case would have raised an exception. Now it
returns (B, first_path_elt(C)).