add osmo_str_startswith()

Move from a static implementation in tdef_vty.c to utils.c, I also want to use
this in osmo-msc.

The point is that the telnet VTY allows unambiguous partly matches of keyword
args. For example, if I have a command definition of:

    compare (apples|oranges)

then it is perfectly legal as for the vty parser to write only

    compare app

One could expect the VTY to then pass the unambiguous match of "apples" to the
parsing function, but that is not the case.

Hence a VTY function implementation is faced with parsing a keyword of "app"
instead of the expected "apples".

This is actually a very widespread bug in our VTY implementations, which assume
that exactly one full keyword will always be found. I am now writing new
commands in a way that are able to manage only the starts of keywords.

Arguably, strstr(a, b) == a does the same thing, but it searches the entire
string unnecessarily.

Change-Id: Ib2ffb0e9a870dd52e081c7e66d8818057d159513
diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok
index 8fce9f1..5783eb1 100644
--- a/tests/utils/utils_test.ok
+++ b/tests/utils/utils_test.ok
@@ -340,3 +340,18 @@
 (need 134 chars)
 T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! -- T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! -- T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off!
 (need 134 chars, had size=63) T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! -- T minus 10 9 8 7
+
+startswith_test()
+osmo_str_startswith(NULL, NULL) == true
+osmo_str_startswith("", NULL) == true
+osmo_str_startswith(NULL, "") == true
+osmo_str_startswith("", "") == true
+osmo_str_startswith("abc", NULL) == true
+osmo_str_startswith("abc", "") == true
+osmo_str_startswith(NULL, "abc") == false
+osmo_str_startswith("", "abc") == false
+osmo_str_startswith("abc", "a") == true
+osmo_str_startswith("abc", "ab") == true
+osmo_str_startswith("abc", "abc") == true
+osmo_str_startswith("abc", "abcd") == false
+osmo_str_startswith("abc", "xyz") == false