Raise a specific error when %-encoding is invalid

Prior to this commit it was difficult to catch and properly handle
invalid encodings in URIs. It's unsafe to `rescue ArgumentError` and
treat all caught exceptions similarly.
This commit allows application developers to properly handle malformed
URIs separate from other kinds of problems that may occur in their app.