We don't need so much access to the internals of CCoinsCacheEntry, since many tests are just exercising invalid combinations this way.
This implies that AddFlags has private access now.
This is a partial backport of core#30906
https://github.com/bitcoin/bitcoin/pull/30906/commits/15aaa81c3818b4138602c127d6a16018aae75687
Depends on D18808