Always perform exec in command.

This avoids the shell process between the parent and the actual command when running without the fork server.
Otherwise when running without fork server but in persistent mode, cleaning up the execution may end up getting the exit status of the shell process instead of the command process.

PiperOrigin-RevId: 949754461
diff --git a/centipede/command.cc b/centipede/command.cc
index 06cc79f..972a056 100644
--- a/centipede/command.cc
+++ b/centipede/command.cc
@@ -205,7 +205,7 @@
   ss.reserve(/*env*/ 1 + options_.env_diff.size() + /*path*/ 1 +
              /*args*/ options_.args.size() + /*out/err*/ 2);
   // env.
-  ss.push_back("env");
+  ss.push_back("exec env");
   std::vector<std::string> env_to_set;
   env_to_set.reserve(options_.env_diff.size());
   // Arguments that unset environment variables must appear first.
@@ -285,7 +285,7 @@
   {
     CENTIPEDE_FORK_SERVER_FIFO0="%s" \
     CENTIPEDE_FORK_SERVER_FIFO1="%s" \
-    exec %s
+    %s
   } &
   printf "%%s" $! > "%s"
 )sh";
diff --git a/centipede/command_test.cc b/centipede/command_test.cc
index 4e638b4..48f4d07 100644
--- a/centipede/command_test.cc
+++ b/centipede/command_test.cc
@@ -39,18 +39,18 @@
 using ::testing::Optional;
 
 TEST(CommandTest, ToString) {
-  EXPECT_EQ(Command{"x"}.ToString(), "env \\\nx");
+  EXPECT_EQ(Command{"x"}.ToString(), "exec env \\\nx");
   {
     Command::Options cmd_options;
     cmd_options.args = {"arg1", "arg2"};
     EXPECT_EQ((Command{"path", std::move(cmd_options)}.ToString()),
-              "env \\\npath \\\narg1 \\\narg2");
+              "exec env \\\npath \\\narg1 \\\narg2");
   }
   {
     Command::Options cmd_options;
     cmd_options.env_diff = {"K1=V1", "K2=V2", "-K3"};
     EXPECT_EQ((Command{"x", std::move(cmd_options)}.ToString()),
-              "env \\\n-u K3 \\\nK1=V1 \\\nK2=V2 \\\nx");
+              "exec env \\\n-u K3 \\\nK1=V1 \\\nK2=V2 \\\nx");
   }
 }
 
@@ -80,7 +80,7 @@
   Command::Options cmd_options;
   cmd_options.temp_file_path = "TEMP_FILE";
   Command cmd{"foo bar @@ baz", std::move(cmd_options)};
-  EXPECT_EQ(cmd.ToString(), "env \\\nfoo bar TEMP_FILE baz");
+  EXPECT_EQ(cmd.ToString(), "exec env \\\nfoo bar TEMP_FILE baz");
 }
 
 TEST(CommandTest, ForkServer) {