Add optimizations for more efficient handling of special folder icons.
Make handling of special folder icons more efficient.
Replace tabs with spaces for indentation.
Fix compilation with old GLib.

Usage of g_slist_free_full() requires #include "glib-compat.h"