Backport "Don't set $_SERVER['HOSTNAME'] in CLI SAPI"

..to match the behavior of Zend PHP.
Backport of #2975