Fix bugs in upgrade script.
Fix bugs in upgrade script.

Handle the case when there are colons in server_name. Handle http
exceptions more gracefully.

rzr/synapse,matrix-org/synapse,rzr/synapse,matrix-org/synapse,TribeMedia/synapse,howethomas/synapse,iot-factory/synapse,illicitonion/synapse,matrix-org/synapse,TribeMedia/synapse,TribeMedia/synapse,TribeMedia/synapse,howethomas/synapse,TribeMedia/synapse,rzr/synapse,howethomas/synapse,iot-factory/synapse,matrix-org/synapse,howethomas/synapse,rzr/synapse,iot-factory/synapse,iot-factory/synapse,illicitonion/synapse,illicitonion/synapse,rzr/synapse,illicitonion/synapse,iot-factory/synapse,matrix-org/synapse,matrix-org/synapse,illicitonion/synapse,howethomas/synapse