LoopControl: use C++11 random numbers rather than POSIX
this also fixes and issue where the range for random(3), which is 2^31-1, was assumed to be RAND_MAX (like rand(3)).
this also fixes and issue where the range for random(3), which is 2^31-1, was assumed to be RAND_MAX (like rand(3)).