Make ExplanationStorage closeable

It is strongly needed for both file-based (for flush) and db-based (disconnect or smth) implementations.

Add `with` statement support for ExplanationStorage.