Remove check for php_sapi_name() == 'cli'. The cron.php code was failing to run on large shared linux servers.
Reason: Many well tuned large Linux servers, run cron jobs in cgi mode, not cli, for greater CPU efficiency, lower memory use, and better PHP opcode caching. But some servers run cron jobs in php cli mode. So you can never rule out either mode.