Allow redirect() to be called before database has been initialized.
Merge pull request #2243 from vanilla/hotfix/redirect

Allow redirect() to be called before database has been initialized.