BUG: Add mutex lock to MersenneTwister GetInstance

Access to singleton variable is protected with mutex. During
initialization concurrent access can result in a segmentation fault.

Common functionality in New and GetInstance was refactored into
CreateInstance.

Change-Id: I96d7a7f7b8b57e8cb293cddfcce2c6c623b3faa6
Merge topic 'FixMersenneTwisterGetInstanceThreading'

d69c93fb BUG: Add mutex lock to MersenneTwister GetInstance