Fix crash on Mac OS X, accessing stdout during static initialisation.