std::rand: move TaskRng off @mut.

Replace with some unsafe code by storing a pointer into TLS-owned heap
data.