fixed track by index for messages in chat2 & typescript d.ts for tcp and udp

TESTED: grunt test & manual test of peer-connection chat2 demo