Transform the getBatch result in SkyFunctionEnvironment instead of copying it. The copying showed up as a source of memory spikiness.

--
MOS_MIGRATED_REVID=117741939
diff --git a/src/main/java/com/google/devtools/build/skyframe/ValueWithMetadata.java b/src/main/java/com/google/devtools/build/skyframe/ValueWithMetadata.java
index 7413a1b..3b93434 100644
--- a/src/main/java/com/google/devtools/build/skyframe/ValueWithMetadata.java
+++ b/src/main/java/com/google/devtools/build/skyframe/ValueWithMetadata.java
@@ -229,6 +229,12 @@
       return ((ValueWithMetadata) value).getErrorInfo();
     }
     return null;
+  }
 
+  static NestedSet<TaggedEvents> getEvents(SkyValue value) {
+    if (value instanceof ValueWithMetadata) {
+      return ((ValueWithMetadata) value).getTransitiveEvents();
+    }
+    return NestedSetBuilder.emptySet(Order.STABLE_ORDER);
   }
 }