fixed console and GM_log detection

so that not everything will end up in a nasty `ReferenceError`