fix switching to username containing special characters

Escape username with encodeURIComponent. It fixes usernames with '+' character etc.

Cherry-picked from https://github.com/Tivix/django-userswitch/commit/d82d99f42b9c4187158c381b1000f1c9db80165d
fix username field handling for custom User model in Django 1.5 and up

Cherry-picked from https://github.com/Tivix/django-userswitch/commit/31636a14d6759ba585cb1658ed8e223c66674425
Merge pull request #9 from Tivix/fix-custom-username-django15

Fix custom username handling with custom User model in Django 1.5 and up