Check for sys.maxunicode when generating utf8

This avoid generating a invalid unicode character in a narrow Python
build