Restore ostream state in random_tests.cc
Simple refactoring for switching signs of integers.