[PATCH 5.1.x] kconfig: Clear "written" flag to avoid data loss