random: use BasicByte concept in randbytes
Summary:
This is a partial backport of core#29625
https://github.com/bitcoin/bitcoin/pull/29625/commits/40dd86fc3b60d7a67a9720a84a685f16e3f05b06
Depends on D19043
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D19044