Enhancements to GDB server I/O thread.
Enhancements to GDB server I/O thread.

- Checksums are validated and nacks sent if invalid.
- Packets are resent if a nack is received from gdb.
- Handling of abruptly closed connections.
- Correct usage of socket send() to ensure the whole packet is sent.
- Split up GDBServerPacketIOThread.run() method.
- Corrected handling of detach_event in inner loop of GDBServer.run().
- Added checksum() function which is use in I/O thread class as well
  as createRSPPacket().

Signed-off-by: Chris Reed <ddbbf6166888b293a1c3f06933a7a3227dbb7a9f@freescale.com>

bridadan/pyOCD,molejar/pyOCD,0xc0170/pyOCD,wjzhang/pyOCD,c1728p9/pyOCD,0xc0170/pyOCD,c1728p9/pyOCD,wjzhang/pyOCD,mesheven/pyOCD,tgarc/pyOCD,0xc0170/pyOCD,matthewelse/pyOCD,oliviermartin/pyOCD,tgarc/pyOCD,devanlai/pyOCD,matthewelse/pyOCD,adamgreen/pyOCD,flit/pyOCD,oliviermartin/pyOCD,devanlai/pyOCD,pyocd/pyOCD,adamgreen/pyOCD,oliviermartin/pyOCD,mesheven/pyOCD,tgarc/pyOCD,pyocd/pyOCD,bridadan/pyOCD,bridadan/pyOCD,molejar/pyOCD,wjzhang/pyOCD,matthewelse/pyOCD,mbedmicro/pyOCD,c1728p9/pyOCD,mesheven/pyOCD,devanlai/pyOCD,flit/pyOCD,molejar/pyOCD,mbedmicro/pyOCD,adamgreen/pyOCD,mbedmicro/pyOCD