Correctly extract exitcode from system's retcode