Properly encode % char when encountering invalid %-encoding in URLs
For example https://example.org/foo%s would cause the session to fail to save, the certificate lock to not show and all sorts of other issues. Just make things simpler by fixing those kinds of invalid percent-encoding in URLs.
Fixes #2128 (closed)