Fix a memory leak in linux sandbox

`getcwd` result is allocated using `malloc` and should be deallocated with
`free`.

However `opt.working_dir` won't own it because that's an `std::string` and
the current `operator=` call will allocate a new buffer and copy the
content of `getcwd` result.

Hence, in the previous solution, the result of `getcwd` was just leaked at
the end of the function.

This commit adds the necessary `free`.

*edit*: I found that when running a C++ ASAN sanitizer during my build. I have a rule which setups the environment with `LD_PRELOAD and apparently bazel is calling the sandbox inside the build environment, hence it inherit the `LD_PRELOAD` setting.

Closes #10599.

PiperOrigin-RevId: 293835331
diff --git a/src/main/tools/linux-sandbox-options.cc b/src/main/tools/linux-sandbox-options.cc
index b399b02..9f0039c 100644
--- a/src/main/tools/linux-sandbox-options.cc
+++ b/src/main/tools/linux-sandbox-options.cc
@@ -262,6 +262,11 @@
   }
 
   if (opt.working_dir.empty()) {
-    opt.working_dir = getcwd(nullptr, 0);
+    char *working_dir = getcwd(nullptr, 0);
+    if (working_dir == nullptr) {
+      DIE("getcwd");
+    }
+    opt.working_dir = working_dir;
+    free(working_dir);
   }
 }