Check for Unicode string if we are writing Unicode-Strings

Together with miracle2k/webassets#335 should pass the tests at last.