util: extract {Read,Write}BinaryFile() to its own files
Summary:
Extract ReadBinaryFile() and WriteBinaryFile() from torcontrol.cpp to its own readwritefile.{h,cpp} files, so that it can be reused from other modules.
This is a backport of core#20685 [1/20]
https://github.com/bitcoin/bitcoin/pull/20685/commits/4cba2fdafa483cbdb70f581174138ec253c80d48
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D11012