At least on my machine, rand spends a lot of time making sure nothing else is using the random number generator currently via a "lock" instruction.
rand_r circumvents this problem by keeping its RNG state in the instance of the class using it, which I believe only runs on a single thread.
This gives a noticable performance improvement for big "airbrush noisy" brushes. for the total random color source, the improvement is measurable, but on my machine it was very slow before and is still very slow (for a big brush - small brushes are fine of course)