Maybe try simply deactivating the feature (`files.save_config_on_file_change` various pref) and see if it helps? That sounds slightly more trustworthy than mtimes, depending on the setup. Anyway, in theory the code guards against loading the session, but there possibly could be something fishy preventing it to work in some situations I guess.