Fixes #1297: CSRF not generated on error pages