relay: wait for message CAP END before sending join of channels and backlog to the client (closes #223)