Handle redirecting the template in EditPage form

If you are editing a template to change it into a redirect and use the
"preview page with this template" in the edit form, it does not
correctly use the target of the new redirect. Fix that, keeping in mind
that Parser::statelessFetchTemplate ignores $wgMaxRedirects and
TemplateSandbox should reproduce that behavior here.

Bug: 56559
Change-Id: Ib7b99a0129ec1eaabfc10e6604bbd55033ac204c
Merge "Handle redirecting the template in EditPage form"