Fix encoding issues in `cut_prefix` and `cut_suffix`.

Basically ensures that either prefix and suffix matches the type of
value, otherwise an UnicodeError might be raised:  If value is Unicode
and prefix is bytes, `value.startswith()` will try to use 'ascii' to
encode `value` before comparing.  That may fail!
Jump to 1.6.2.
Merge branch 'release-1.6.2'