PCT-697: Agent is running but PCT says it's not

* PCT-697: Agent is running but PCT says it's not
* PCT-629: Agent running but not connected
Why we are Sleeping here? Waiting for s.server.Run to start? Isn't there more deterministic way to do that? E.g. asking server every few milliseconds if he started or sending "ready" signal over channel? If not then code comment would be welcome.