Replace random.randint() with os.urandom()
Remove unused imports
Merge pull request #16327 from basepi/bp-16322

Backport #16322 to 2014.7