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/main/java/com/google/devtools/build/lib/vfs/SearchPath.java b/src/main/java/com/google/devtools/build/lib/vfs/SearchPath.java
index 7f7d8c7..764ed0d 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/SearchPath.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/SearchPath.java
@@ -37,7 +37,7 @@
       return paths;
     }
     for (String p : SEPARATOR.split(searchPath)) {
-      PathFragment pf = new PathFragment(p);
+      PathFragment pf = PathFragment.create(p);
 
       if (pf.isAbsolute()) {
         paths.add(fs.getPath(pf));
@@ -53,7 +53,7 @@
    */
   @Nullable
   public static Path which(List<Path> searchPath, String exe) {
-    PathFragment fragment = new PathFragment(exe);
+    PathFragment fragment = PathFragment.create(exe);
     if (fragment.segmentCount() != 1 || fragment.isAbsolute()) {
       return null;
     }