client emits error if server disobeys protocol

also fix error of ignoring upgradeHead