Implemented a new "locked pointer" class that serializes access to a pointer
across multiple threads, and put it to use guarding the global RNG. Thus the
global RNG is now thread safe, but you have to be careful about how you use
it because you could ruin performance if you are constantly grabbing and
releasing the lock.