jrep: Improve multi-threading.

The multi-threading heuristics have been updated to prevent performance from
falling down when many threads are assigned to the task.
jrep: Correctly free allocated resources
jrep: Let the '-j' option automatically select the number of threads to use.

Without a number specified, the '-j' option will let jrep use one thread per core
available.
Update gjrep.py to benchmark jrep with the automatic '-j' option.
Add a '--engine' option to gjrep.py to specify grep utilities to benchmrak.