Fix deadlock bug in MailIndex.save_changes() and a few typos