refactor: use Span in random.*
Summary:
This is a backport of core#24213
Depends on D14826
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D14827