progs/tests: Use rand() instead of random().