coins, refactor: Remove direct GetFlags access
Summary:
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
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18809