fix bug 990607: Ignore badly encoded referer headers when detecting search referer

Not sure if this is the best way to resolve this bug, but it at least stops the error. The problem is that Python's `urlobject.URLObject` just does gracefully handle a `Referer:` header that looks like this:
```
http://developer.mozilla.org/fr/docs/JavaScript/RÃ©fÃ©rence_JavaScript/RÃ©fÃ©rence_JavaScript/Objets_globaux/Date/parse
```