Use rand_r to avoid linking against impure_ptr stuff in newlib.
This saves almost 1 kb of ram.