Read filetype's mime type from the configuration files

This allows custom filetypes to define a mime type, hence the icon
displayed for this filetype;  as well as moving ones for built-in
filetypes out of the code to the configuration files.
Use GIcon for the filetype icon rather than rendered pixbuf

This allows to re-use the icon more easily since it's not rendered at
a particular size but simply an icon description.  It also allows for
implicit icon updating when the theme changes if the display code
implements it (and GTK widgets does).
Plug a possible memory leak

There is no need to check doc->real_path since the usage is NULL-safe,
and if it actually is empty or NULL it isn't a bug in the caller itself
anyway, and this could leak.
Simplify utils_get_hex_from_color() and plug a possible memory leak in it
Plug a possible memory leak
Fix mismatching allocation and deallocation

When allocation with g_malloc(), the memory should be freed using
g_free(), not plain free().

Also, use g_try_malloc() instead of g_malloc() where the code carefully
handles allocation failures itself.
Remove an unused variable that could be leaked
Plug a memory leak
Plug a possible memory leak
Explicit a valid cast
Plug a memory leak on Windows
Remove an unused variable and plug a theoretical memory leak
R has braces
Fix some small type issues in printf formats
Fix 2 unlikely memory leaks
Fasten utils_tidy_path() a little and fix possible leaks in it

Fix possible leaks with bad paths, and also speed up some part of the
function by avoiding unnecessary allocations and string length
computations.
Always use proper functions argument lists
Don't depend on an implementation detail of S_ISREG and S_ISDIR
Use proper argument list
Fix crash in fallback mime icon loading code under GTK3