Fixed #6668 Optimise utils.text wrap

https://code.djangoproject.com/ticket/6668 I tested SmileyChris's 5-yr old patch. The existing tests in utils_tests pass when this patch is implemented.  Feel free to code review. Thanks.