Use system_error in random_device.  Fixes #8245.