fix divide by zero in random/taviso()

In random.c the taviso() routine uses "rand() % rand()" which
can cause a floating point exception if rand() returns 0.
Add some tests to make sure that doesn't happen.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>