test: cover read-only blockstore
Summary:
Add a test to cover the behavior described in https://github.com/bitcoin/bitcoin/issues/2039, in preparation for fixing it.
I massaged the functional test: fewer levels of try-except wrapping, deduplication of the platform specific code (only the command name changes based on the OS)
This is a backport of core#28545, core#27850 and core#28660
Depends on D18969
Test Plan:
ninja check check-functional
Try with the chattr unavailable on linux and check that the test is reported as skipped.
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18971