Check newly created consistency using _PyUnicode_CheckConsistency(str, 1)

 * In debug mode, fill the string data with invalid characters
 * Simplify also reference counting in PyCodec_BackslashReplaceErrors()
   and PyCodec_XMLCharRefReplaceError()
diff --git a/Python/import.c b/Python/import.c
index 8cf10e6..103e7de 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -992,6 +992,7 @@
                              (j = dot0-right));
     PyUnicode_WRITE(kind, data, i+j,   'p');
     PyUnicode_WRITE(kind, data, i+j+1, 'y');
+    assert(_PyUnicode_CheckConsistency(result, 1));
     return result;
 }