Fix modulo bias, comment on unsafe code.

Note that I haven't tested these changes (I did it in a github window) - but I'm sure you get the gist of them :)
Interesting note: this would've introduced a serious bug; max is implicit cast to signed by this loop, so values over INT_MAX would give a mask of 0 (and always return 0). One usage of this function is:

```c
qsrand(SecureRNG::randomInt(UINT_MAX));
```

Which means we would've always seeded rand() with 0; not that rand() is used by anything interesting, and its only use will be going away soon.