flags use the memstore

* add new/dirty deferred dict to notify when written to disk
* fix eventual duplication after copy
* fix flag flickering on first retrieval.
use enums for dict keys
recent-flags use the memory store
handle last_uid property in memory store
fix find_charset rebase