Fire `connected` event on startup if 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.