Replace the OpenMP critical section in connection caching by a lock per accelerator

There was 2 issues:
- first a performance issue in verbose mode with a big lock around verbose
  output;
- an accelerator was able to be called twice at the same time by 2
  different threads on the host.

Using an individual lock on the host per accelerator for the whole length
of a accelerator call solves both issues.