Now also saves the lists of chat when closing the main form directly (previously only saved when selecting the 'logout' option).