Make sure @omero_host@ is never present (fix #12555).

This fixes the issue when an insecure connection is
requested and the connection string still contains
@omero_host@.

To test:
- verify that scripts still work,
- check that a sample script from the ticket description (https://trac.openmicroscopy.org.uk/ome/ticket/12555) works. Save the code to a file, send it to the server as a script and execute (`bin/omero script launch <id>`). No errors should be present.

/cc @joshmoore, @sbesson 

--no-rebase
So, judging by the loop, it helps to pick the last endpoint as the host?