python: Make invalid UTF-8 sequence messages consistent across Python versions.