bz19795: Fix crash in renderer initialization code

I'm not sure exactly what's happening, but it seems like a threading
issue to me.  Moving the code so that it happens before the portable
startup code, seems to fix things for me.