For bug 1068016: handle search request with non url query

Use urllib.quote method to take care of spaces and special characters (url value may contain search queries other than the actual http url)
For example, "mozilla QA" need to be converted to "mozilla%20QA"

Resubmitting instead of #24304 that was closed without merging.