Fixes UnicodeEncodeError sometimes

@jezdez this is about yesterday pull request https://github.com/django-debug-toolbar/django-debug-toolbar/pull/347.