[ticket/11672] Move the reapply_sid() call before meta_refresh() is called.

The $redirect assignment is not necessary because the variable  has already been
set near the start of the functions. The redirect value will also never default
to index.php because a default value has already been provided when $redirect
is initially assigned and passed to the template as a hidden field.

PHPBB3-11672