Windows gdb+gdbserver: Share exit status logic
Move the exit status logic added by commit 559e7e5056 ("Improve
process exit status macros on MinGW") from both GDB and GDBserver to a
shared routine used by both.
The next patch extends this routine with Cygwin-specific decoding.
Change-Id: I4bf08c6beff0d1688064a81d49bbdd615643735e