editor: fix mem leak when calling gtk_editable_get_chars

The return value of gtk_editable_get_chars is owned by the caller, so
calling g_strdup leaks memory.

Signed-off-by: Thomas Haller <thaller@redhat.com>
editor: refactor filtering of characters for GtkEntry

Some GtkEntry only allow certain characters. This code was duplicated
over several places. Refactor them and add a function
utils_filter_editable_on_insert_text to implement the filtering.

This also fixes some minor hitches:

- at some places, the is<type> functions from ctype.h were used. These
  functions behave differently depending on the locale, but we ~really~
  want to check for ASCII characters (in the UTF-8) string.

- at several places, the allocated memory for `result` did not include
  the terminating zero caracter. This was not a real bug, because
  gtk_editable_insert_text was called with the `count` parameter and
  nowhere the terminating zero was actually needed.

- adjust the signature of the *_filter_cb functions to the insert-text
  signal.

Signed-off-by: Thomas Haller <thaller@redhat.com>
editor: disallow unexpected characters for DNS servers

Do not allow to input unexpected (ascii) characters as DNS servers,
both for IPv4 and IPv6.

This especially disallows to add a %scope-id suffix for IPv6 link-local
addresses (because '%' is not allowed). The reason to disallow this is
that link-local addresses are always scoped to the connecting device
anyway, so this parameter would get ignored anyway.

This is related to bug
https://bugzilla.redhat.com/show_bug.cgi?id=962449

Signed-off-by: Thomas Haller <thaller@redhat.com>
editor: extend tooltip for IPv6 DNS servers in ce-page-ip6 (scope of link-local)

The user cannot input a %scope-id in this field because this parameter
would be ignored anyway. NetworkManager automatically scopes link-local
addresses to the connecting device.

https://bugzilla.redhat.com/show_bug.cgi?id=962449

Signed-off-by: Thomas Haller <thaller@redhat.com>