Make detect-mime-charset-region slightly less horrible.

In order to detect the right charset to use for a text part, we used
to convert the region to a string, then convert that string to a list,
then uniquify the resulting list.  We now build the unique list on the
fly.