edify: Move State.script and State.errmsg to std::string.

This way we kill a few strdup() and free() calls.

Test: 1. recovery_component_test still passes;
2. Applying an update with the new updater works;
3. The error code in a script with abort("E310: xyz") is recorded into
last_install correctly.

Change-Id: Ibda4da5937346e058a0d7cc81764d6f02920010a
(cherry picked from commit 59dcb9cbea8fb70ab933fd10d35582b08cd13f37)
diff --git a/tests/component/edify_test.cpp b/tests/component/edify_test.cpp
index ded8540..ede2ecb 100644
--- a/tests/component/edify_test.cpp
+++ b/tests/component/edify_test.cpp
@@ -25,10 +25,7 @@
     int error_count;
     EXPECT_EQ(parse_string(expr_str, &e, &error_count), 0);
 
-    State state;
-    state.cookie = nullptr;
-    state.errmsg = nullptr;
-    state.script = strdup(expr_str);
+    State state(expr_str, nullptr);
 
     char* result = Evaluate(&state, e);
 
@@ -38,8 +35,6 @@
         EXPECT_STREQ(result, expected);
     }
 
-    free(state.errmsg);
-    free(state.script);
     free(result);
 }