misc: Replace the idiom for replacing a string with a function call

Remove a lot of code in favor of a new function that is freeing
the old string and copying the new one. I should have gotten the
context and the strings right.
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index e11b48c..89d7d4b 100644
--- a/openbsc/src/nat/bsc_nat_utils.c
+++ b/openbsc/src/nat/bsc_nat_utils.c
@@ -28,6 +28,7 @@
 #include <openbsc/gsm_data.h>
 #include <openbsc/debug.h>
 #include <openbsc/ipaccess.h>
+#include <openbsc/vty.h>
 
 #include <osmocore/linuxlist.h>
 #include <osmocore/talloc.h>
@@ -100,9 +101,7 @@
 
 void bsc_nat_set_msc_ip(struct bsc_nat *nat, const char *ip)
 {
-	if (nat->msc_ip)
-		talloc_free(nat->msc_ip);
-	nat->msc_ip = talloc_strdup(nat, ip);
+	bsc_replace_string(nat, &nat->msc_ip, ip);
 }
 
 struct bsc_connection *bsc_connection_alloc(struct bsc_nat *nat)