use static locals instead of global pointers for some singletons
(proably more valgrind happyness; followup 572bda85)