rpc: Prevent dumpwallet from overwriting files
Summary:
Prevent arbitrary files from being overwritten. There have been reports
that users have overwritten wallet files this way. It may also avoid
other security issues.
Fixes #9934. Adds mention to release notes and adds a test.
Backport core's PR9937
Depends on D1165
Test Plan:
make check ./test/functional/test_runner.py wallet-dump
Reviewers: #bitcoin_abc, schancel
Reviewed By: #bitcoin_abc, schancel
Subscribers: teamcity
Differential Revision: https://reviews.bitcoinabc.org/D1166