Use less iterations for KeyGenerator in tests

This commit improves performance of cookie tests:

Ruby  |   After  |   Before
----- | --------:| --------:
MRI   |    5.03s |     9.28s
JRuby |   25.45s |  1648.23s

Please note the improvement for JRuby.
Merge pull request #16717 from splattael/keygenerator

Use less iterations for KeyGenerator in tests