machines: fix race condition that made the VNC Console temporarily disconnected
machines: fix race condition that made the VNC Console temporarily disconnected

In order that the VNCConsole component can connect to libvirt's VNC
server we pass as property the path/port is should connect to.
The port is available from the domain's libvirt XML, see `virsh dumpxmp
VMNAME | grep vnc`.
The recommended option for the VMs VNC configuration is however to set port=-1,
in this case the port is changed in the XML to an actual port number once the
VM is running and the VNC server is ready to use, or in other words the
port is autoallocated.

In our case there was this racy scenario where the VNCComponent would be
supplied with an invalid URL where the port would be -1, in case the VM just
started and the port just changed value in the XML. That would make the connection
fail and the user would need to refresh the page in order for the URL to be
regenerated with the correct port and passed again to the VNCConsole component.

Fixes #13158
Fixes #13880

mvollmer/cockpit,garrett/cockpit,garrett/cockpit,martinpitt/cockpit,mvollmer/cockpit,garrett/cockpit,cockpit-project/cockpit,martinpitt/cockpit,cockpit-project/cockpit,cockpit-project/cockpit,martinpitt/cockpit,garrett/cockpit,martinpitt/cockpit,mvollmer/cockpit,garrett/cockpit,cockpit-project/cockpit,martinpitt/cockpit,mvollmer/cockpit,cockpit-project/cockpit,mvollmer/cockpit