Make static cache thread_local.
Merge pull request #1146 from ktf/thread-local-cache-TrackingTools/TrajectoryFiltering

Multithreading fixes -- Make static cache thread_local.