Fix notices in CLI mode

I want to use cockpit collections under cli mode, but I get annoying PHP Notices for SERVER_NAME and SERVER_PORT, so I did this simple workaround.