shell: Don't let "?machine=undefined" leak into the URL

This will come back as a string and we will try to connect to a host
named "undefined" via SSH.

Reviewed-by: Stef Walter <stefw@redhat.com>