test: Implicitly sync after generate*, unless opted out
Summary:
Backport of core#23300.
Depends on D12521.
Note: There are some extra sync_* calls after this diff, which are left as-is because they are cheap and the diff is already large enough.
Test Plan:
ninja check-functional-extended
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D12522