Fix random crash on an ugly string handling in bsd backend.

Replace an horrible strlcat loop + g_snprintf by g_strjoinv + g_strlcpy.
Assert that the buffer is valid UTF8, blow otherwise.