Fixed #19508 -- Used uri_to_iri.

This is a PR for ticket #19508 for which another PR #2919 was opened by me a few days ago.
This PR implements `uri_to_iri` as per RFC and changes the `PATH_INFO` at the very time when `environ` is being set contrary to the previous one which corrected the received url from `environ`.
This comment thread is rather outdated as it survived many iterations of the patch, anything before this point can be ignored.

One piece of design I'm indecisive about: should we return unicode or UTF-8? Both more or less make sense:

- Our internal usage of the function ultimately wants UTF-8 on PY2 and UTF-8 decoded as LATIN1 on PY3, so returning UTF-8 is a little more convenient.

- Although the existing `uri_to_iri()` accepts both UTF-8 and unicode input, I suspect it's better practice for the application to deal with unicode strings, so in that case it would be better to have `iri_to_uri(uri_to_iri(unicode_string)) == unicode_string`.