libcore: make rand::random return a generic value implementing `Rand`.

With this patch `rand::random` can be used to generate anything that implements `Rand`.