test: Add pure Python RIPEMD-160 and use it instead of OpenSSL
Summary:
OpenSSL 3 removed ripemd160, see openssl/openssl#16994
Thus, the functional tests fail on systems with OpenSSL 3.
This is a backport of core#23716
Test Plan: ninja check-functional-extended
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D11413