Add checks in PyUnicode_WriteChar() and convert PyUnicode_New() assertion to a test raising a Python exception.