Add type annotation for JournalWriter related code
- add a JournalWriterInterface in a new interface.py module,
- add a flush() method to this interface,
- remove (now unused) write_update methods,
- move all type-related code in this module,
- fix InMemoryJournalWriter type annotations,
- remove usage of the TValue TypeVar in favor of using ValueProtocol directly.