Work around a character-encoding issue in search.

The problem here is that non-ASCII referers will sometimes behave
properly but sometimes not. Properly fixing this would likely be more
effort than it's worth, as it would involve cleaning up things like
borked "Ã±" sequences in referers.

So this simply slaps a small band-aid on the problem: when URLObject
throws a UnicodeDecodeError, we bail out rather than trying to undo
whatever sequence of multiply-encoded byte mangling turned the referer
into the monster that it is.
Merge pull request #2296 from ubernostrum/search-non-ascii-referer

Work around a character-encoding issue in search.