std::rand: move TaskRng off @mut.

Replace with some unsafe code by storing a pointer into TLS-owned heap
data.
auto merge of #10588 : huonw/rust/un@mutilate-task_rng, r=alexcrichton

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