PEP 466: backport persistent urandom fd (closes #21305)

Patch from Alex Gaynor.