collect: fix crash in case of non-valid utf8 database entries

g_markup_escape_text() does not tolerate invalid utf8 strings.
we need to to fix those upfront.

@jcsogo: please review