A thread-safe secure random number generator