Update misc.lua

If the _G metatable is protected that code will error, so I've added a line that detects if it is and stops it from trying to run that code.