Fix EZP-23364: case-correction redirects with tree_root setting

This PR resolves issue https://jira.ez.no/browse/EZP-23364

Case-correction redirect logic was not considering possible `content.tree_root.location_id` configuration option different from default content tree root. 

This is continuation of https://github.com/ezsystems/ezpublish-kernel/pull/1004 by @wizhippo, adding some additional fixes and tests.

Tests: unit test + manual integration testing.
For readability sake, can you please assign `$pathPrefix` before the condition?