Change seed validation for Cong and SHR3 to be more "general".

This is prompted by the work on C++ template random engines.