Refactor all ctor callsites of PathFragment to instead call a static 'create' method.

This paves the way for changing PathFragment to e.g. an abstract class with multiple subclasses. This way we can split out the windows-specific stuff into one of these concrete classes, making the code more readable and also saving memory (since the shallow heap size of the NonWindowsPathFragment subclass will hopefully be smaller than that of the current PathFragment).

This also lets us pursue gc churn optimizations. We can now do interning in PathFragment#create and can also get rid of unnecessary intermediate PathFragment allocations.

RELNOTES: None

PiperOrigin-RevId: 152145768
diff --git a/src/test/java/com/google/devtools/build/lib/vfs/RootedPathTest.java b/src/test/java/com/google/devtools/build/lib/vfs/RootedPathTest.java
index 83a7211..7ad6531 100644
--- a/src/test/java/com/google/devtools/build/lib/vfs/RootedPathTest.java
+++ b/src/test/java/com/google/devtools/build/lib/vfs/RootedPathTest.java
@@ -40,12 +40,14 @@
   public void testEqualsAndHashCodeContract() throws Exception {
     Path pkgRoot1 = root.getRelative("pkgroot1");
     Path pkgRoot2 = root.getRelative("pkgroot2");
-    RootedPath rootedPathA1 = RootedPath.toRootedPath(pkgRoot1, new PathFragment("foo/bar"));
-    RootedPath rootedPathA2 = RootedPath.toRootedPath(pkgRoot1, new PathFragment("foo/bar"));
-    RootedPath absolutePath1 = RootedPath.toRootedPath(root, new PathFragment("pkgroot1/foo/bar"));
-    RootedPath rootedPathB1 = RootedPath.toRootedPath(pkgRoot2, new PathFragment("foo/bar"));
-    RootedPath rootedPathB2 = RootedPath.toRootedPath(pkgRoot2, new PathFragment("foo/bar"));
-    RootedPath absolutePath2 = RootedPath.toRootedPath(root, new PathFragment("pkgroot2/foo/bar"));
+    RootedPath rootedPathA1 = RootedPath.toRootedPath(pkgRoot1, PathFragment.create("foo/bar"));
+    RootedPath rootedPathA2 = RootedPath.toRootedPath(pkgRoot1, PathFragment.create("foo/bar"));
+    RootedPath absolutePath1 =
+        RootedPath.toRootedPath(root, PathFragment.create("pkgroot1/foo/bar"));
+    RootedPath rootedPathB1 = RootedPath.toRootedPath(pkgRoot2, PathFragment.create("foo/bar"));
+    RootedPath rootedPathB2 = RootedPath.toRootedPath(pkgRoot2, PathFragment.create("foo/bar"));
+    RootedPath absolutePath2 =
+        RootedPath.toRootedPath(root, PathFragment.create("pkgroot2/foo/bar"));
     new EqualsTester()
       .addEqualityGroup(rootedPathA1, rootedPathA2)
       .addEqualityGroup(rootedPathB1, rootedPathB2)