Without the $GLOBALS["___mysqli_ston"] being present the code would fail much earlier. It doesn't make sense to check it only here.
This commit converts all mysql_* function to the appropriate counterparts in mysqli. I used this tool for most of it: https://github.com/philip/MySQLConverterTool This makes it possible to continue using MysqlDumper with PHP 7.0