[ticket/12831] Allow events in page_header functions to prevent the setting of HTTP headers

https://tracker.phpbb.com/browse/PHPBB3-12831
this is checking for a developer error like setting the var to a string in the event listener