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

http://tracker.phpbb.com/browse/PHPBB3-12193