Make non-const statics const or atomic
Remove unused variable
Merge pull request #1296 from wmtan/MoreThreadSafetyFixes

Multithreading fixes -- Declare more framework non-const statics const or atomic