fix for #759.

Mirror of #725 fix.

Update trec_len, trec_pos to 32 bits from 16 bits.
Handle handshakes that are fragmented across records.