Add pry for debugging purposes
Safe guard for frozen environment variables

The environment variables are frozen in the later stage of Rails' request
cycle. Adding a safe guard to prevent any modifications to the environment
variables if any of them is frozen.

This is a pre-step to implement the fix for handling non-UTF8 byte sequence
coming from a request generated by Windows machines. Without this safe guard we
will see this exception being thrown: `!! Unexpected error while processing
request: can't modify frozen String`.
Force encoding more invalid UTF-8 characters

Byte sequence from "\x80" to "\xff" will cause `ArgumentError: invalid byte
sequence in UTF-8` when you are trying to do `URI.decode("\x80")`.

The fix is to force encode the environment variables into UTF-8, and replace
invalid characters with `?`, before handing it over to the `URIString`.