Improvements to GDBServer main loop.
Improvements to GDBServer main loop.

- Refactored inner loop of run() into new _run_connection() method.
- Added exception handlers to run() and _run_connection().
- Waiting for packet thread to exit in stop().

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

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