Refs #3860 - add Kernel.rand to safemode functions

This is handy function that is needed for auto-provisioning of discovered
hosts: https://github.com/theforeman/foreman_discovery/pull/98