[ticket/12193] Fix broken HTML if SQL error occurs during migration

PHPBB3-12193