Finally found a working solution without changing the core/Common.php file.
I added my own is_cli() function to application/config/constants.php
Maybe it's not the most elegant solution, but I found in core/Codeigniter.php that the constants.php file is loaded right before Common.php.