fix: give effect teardowns the value from before the first write in a flush (#18620)