Bind the RC server to localhost:0 and read the bound URL back via a new rcserver.Server.URLs() accessor instead of pre-allocating a port in cmd/gui. This removes the small TOCTOU race window between freePort() closing its listener and rcserver claiming the same port.