Making fastjet 3.1.0 more thread-safe

Here are a number of commits to make fastjet 3.1.0 more thread safe.