Make MersenneTwister equivalent in 32- and 64-bit architectures

As mentioned in issue #5999, reproduce the solution in 67f6fee for the MersenneTwister.

Note that users on 64-bit architectures will see their randomness change with no change in their seed.
Merge pull request #6018 from jperla/newtwist

RFC: Make MersenneTwister equivalent in 32- and 64-bit architectures