You can set the test iteration count by command-line parameter but it is very hard to control the iteration count used by make check and even harder to control the count when this is run through Bitcoin Core's build system. Using an environment var solves both problems.
Backport of secp256k1#851