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/Modules/sha256module.c b/Modules/sha256module.c
index f1ef329..76d91af 100644
--- a/Modules/sha256module.c
+++ b/Modules/sha256module.c
@@ -466,6 +466,7 @@
         c = (digest[i] & 0xf);
         hex_digest[j++] = Py_hexdigits[c];
     }
+    assert(_PyUnicode_CheckConsistency(retval, 1));
     return retval;
 }