Fix EZP-21547: headers not sent for cached errors

The headers are added to the module result, and stored
in cache. They are then sent to the browser when rendering
the result, cached or not.