doc: only write changed metadata to session config
Kate for e.g., stores metadata per doc in an ini file. Due to us storing a lot of entries per doc, the file ends up being very large. This results in slow downs while starting up/closing docs for e.g.,