[1.7.x] Fixed #23946 -- Fixed runserver crash when socket error contains Unicode chars.

Backport of bba545345f46f09245799f7ae0a22177a84eba71 from master