Fixed name error bug in function safe_unicode in module py3compat.