Make statics thread local in TrackingTools/TrajectoryCleaning

For thread safety, two non-const static variables are made thread local.  These variables used to be on the stack, but were made static as a performance optimization.