Make sure ErrorPageFilter is only applied once per request

Fixes gh-1257