Fix path detection

Alternative for https://github.com/phpbb/phpbb3/pull/1702 for develop

This PR fixes function phpbb_get_web_root_path() so it generates correct path variable even when URL is incorrect.

PHPBB3-11832