Make the rand tests determinstic.

This avoids spurious errors with the old tests but still tests
 enough that if the rng is replaced with a totally broken one
 it should still fail.