Added thread safety to the SoundManager.