C: more 5.18 protections for empty GV and CV stashes

testcase: Module::Build
t/bytecode.t: more failing and passing 5.18 tests