Make benchmark adaptive.

Require at least 500 ms to run each benchmark. If it runs for less,
add iterations and repeat.

This makes some functions 2-3x "faster" on fast CPUs (looks like there
was not enough running time for better JIT optimizers to kick in).