test: clean up setexpr_test_str()

Assign variable buf in the sub-test where it is used.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
diff --git a/test/cmd/setexpr.c b/test/cmd/setexpr.c
index 7f318a42..cc2003f 100644
--- a/test/cmd/setexpr.c
+++ b/test/cmd/setexpr.c
@@ -309,10 +309,10 @@
 	 */
 	ut_assertok(env_set("fred", "x"));
 	start_mem = ut_check_free();
-	strcpy(buf, "hello");
 	ut_asserteq(1, run_command("setexpr.s fred 0", 0));
 	ut_assertok(ut_check_delta(start_mem));
 
+	strcpy(buf, "hello");
 	ut_assertok(env_set("fred", "12345"));
 	start_mem = ut_check_free();
 	ut_assertok(run_command("setexpr.s fred *0", 0));