fixed case in which a the bytes could be skipped when the handshake was
received in multiple parts and the last part was including nonpayload
data.