Fire `connected` event on startup when remote already connected

This fixes a last issue with the events: if the remote is already connected (usually when reloading the page while being connected), it should also fire the `connected` event. Forgot that in the PR yesterday and noticed it while continuing using it in an app.