If connection is interrupted (for example qubesd restart), attempt to reconnect.
This is mostly moved from qubes.ext.gui module.