websocket: simplify Upgrade() and minimise allocations.