Fix crash when opening kleopatra with a file
Kleo crashes because the mainWindow doesn't exist. The code creates it if necessary, but only after we're already trying to use it
Kleo crashes because the mainWindow doesn't exist. The code creates it if necessary, but only after we're already trying to use it