- make filerec_open and filerec_close thread safe

- we can't use filerec->tmp_list in a threaded context, so use a
  filerec_token tree to track open files during a dedupe pass.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Use a thread pool for the dedupe phase.

With the open/close code in filerec.c using locking, this becomes easy. We
have to lock around the count updates but instead of doing that directly, we
use thread-local variables and then update a thread-global counter after our
dedupe is complete.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
- Change --hash-threads option to --io-threads.

- rename hash_threads global variable to io_threads
  - Use io_threads threads in dedupe_results().

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Merge branch 'threaded-dedupe'