Move the BlazeRuntime.initProfiler call to BlazeCommandDispatcher

The intend is to move the profiler setup earlier in the startup sequence, so we
can get more profiler coverage. Ideally, we'd setup the profiler immediately
after getting the client call, but this is not currently possible due to the
requirement that initialization and shutdown happen in pairs (otherwise the
next command invocation crashes with an exception from the Profiler).

PiperOrigin-RevId: 200707029
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
index b2c9607..12276f4 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
@@ -260,10 +260,8 @@
     return moduleInvocationPolicy;
   }
 
-  /**
-   * Conditionally enable profiling.
-   */
-  private void initProfiler(
+  /** Configure profiling based on the provided options. */
+  void initProfiler(
       EventHandler eventHandler,
       BlazeWorkspace workspace,
       CommonCommandOptions options,
@@ -439,14 +437,8 @@
    * @param options The CommonCommandOptions used by every command.
    * @throws AbruptExitException if this command is unsuitable to be run as specified
    */
-  void beforeCommand(CommandEnvironment env, CommonCommandOptions options, long execStartTimeNanos)
+  void beforeCommand(CommandEnvironment env, CommonCommandOptions options)
       throws AbruptExitException {
-    initProfiler(
-        env.getReporter(),
-        env.getBlazeWorkspace(),
-        options,
-        env.getCommandId(),
-        execStartTimeNanos);
     if (options.memoryProfilePath != null) {
       Path memoryProfilePath = env.getWorkingDirectory().getRelative(options.memoryProfilePath);
       MemoryProfiler.instance()