Since PipelineC is not thread-safe, add a lock to all function calls to
it to avoid any thread safety-related issues.
At the same time, use a thread pool to run "expensive" PipelineC
functions in GraphQL (specifically `produce_target` and `run_analysis`)
to avoid problems due to the cooperative nature of Python coroutines.