Fix initialization issues for pseudorandom number streams

The `stream` variable is now threadprivate and both `stream` and `prn_seed` are initialized inside an OpenMP parallel region so that all threads have appropriate values.