Fix race warning

CID 1201438
Resolve static initialization order fiasco
Add simple readers-writer lock implementation
Discard .ini cache when it's not being accessed

Refs #4193
Use the right prefix for bool variable
StatusBar: less greedy invalidation

Fixes rare flickering.
MainFrame: call OnGetMinMaxInfo() before resize
Cosmetics