[ticket/12207] Forum broken when error thrown

Fix display of forum when error is outputted before &lt;html&gt; tag.

Similar to #2011

http://tracker.phpbb.com/browse/PHPBB3-12207