base: Use the shell to determine default host if loaded into shell

When cockpit.js code is loaded into the shell, use the shell to determine
the default host rather than requiring it to be passed in all over the
place.

This lets us write future proof code. Later on when everything is migrated
we can remove this hack.
When rebased to current master, get_page_machine might now be called when current_params is still unset, when hosts_init runs.  I think this should be fixed by explicitly using "localhost" in hosts_init.