Fix ugly error style on install

By initializing the template engine first we can show the
'Can't write into config directory 'config'' error in a nice way instead
of plain unstyled HTML.
Merge pull request #3089 from guruz/fix_ugly_config_writeability_error

Fix ugly error style on install