base: Send cockpit protocol via parent frame where possible

Instead of each frame opening up their own websocket, send
messages via the parent frame if possible.