Handle process signalling correctly on AIX
Handle process signalling correctly on AIX

POSIX shells set the exit code to 128 + the signal number, which
coincidentally matches the layout used by the WIFSIGNALLED/WTERMSIG
macros on most Unix-like systems, but not on AIX. Instead, AIX stores
the signal value in the bottom 8 bits and also bits 16-23. The only time
ninja currently handles signals correctly is when the shell used to call
the program dies via signal.

To handle both scenarios, we detect the shell exit code format and
convert it to the format that the WIFSIGNALED/WTERMSIG macros expect.

Fixes #1623

AoD314/ninja,bradking/ninja,iwadon/ninja,sgraham/ninja,bradking/ninja,Qix-/ninja,ninja-build/ninja,AoD314/ninja,Qix-/ninja,AoD314/ninja,maruel/ninja,maruel/ninja,ninja-build/ninja,iwadon/ninja,ninja-build/ninja,bradking/ninja,Qix-/ninja,iwadon/ninja,bradking/ninja,sgraham/ninja,AoD314/ninja,maruel/ninja,Qix-/ninja,iwadon/ninja,maruel/ninja,sgraham/ninja,ninja-build/ninja,sgraham/ninja