gui/mdmwebkit: Ensure we cleanup allocated strings

This commit also drops the redundant replacements in html_encode by
making use of g_markup_printf_escaped, which will safely escape
non displayable markup characters such as < > &, etc. using their
HTML-safe equivalents, such as &amp;.