g_stderr is used e.g. in lua_printstack() and errorfb() so I kept this variable for easy access (although it won't be used for cleanup).

An alternative would be to lookup that object in both functions via getfile("_STDERR") and avoid g_stderr, too.