Rename some globals and prefix them with 'g_'

Make it easier to identify globals and fix C6244.