Make static nLastFlush and nLastWrite Chainstate members
Summary:
Now that assumeutxo is well on the way, and multiple CChainState exist, we should review the mutable static local variables in CChainState methods. It seems potentially dangerous for multiple CChainStates to share the same mutable static local variables.
ref T3378
This is a backport of core#26513
Depends on D15001
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Maniphest Tasks: T3378
Differential Revision: https://reviews.bitcoinabc.org/D15002