email: Handle poorly encoded email headers

Handle cases where email headers contain unicode or high-ascii characters
and are not encoded according to RFC-2047. This patch handles a special case
where a detectable unicode character set is used, such as UTF-8. For
high-ascii characters in a character set other than iso-8859-1, the result
of this patch is undefined.

Fixes #826