Backport 6df456f8fc6d.
Issue #16335: Fix integer overflow in unicode-escape decoder.
fix for f4d30d1a529e
Python 2.7 has only assertRaisesRegexp, not assertRaisesRegex
Fix memory error in test_ucn.
unicode-escape decoder requires memory for result corresponding to input size.
Fixes test for issue #16335.