Make reverse routes always use the first matching route

Fixes #3050. The previous way of removing the extra routes would prioritize the last matching route as opposed to the first one. Now it should work the same as in 2.2, but without the warning.
I would definitely appreciate a release for this fix, since the cosmetic difference in the generated URL can be problematic. In our case it adds a trailing slash to a very common URL in our application because it is using the more specific version of the route (i.e. /a/b/c) to generate the less specific version (i.e. /a/b), which results in /a/b/.