Harmonize uses of exit()

Using standard constants instead of 1 or 0 to improve readability, and maybe some portability gains:

exit(3):

    The  use  of EXIT_SUCCESS and EXIT_FAILURE is slightly more portable (to non-UNIX environments)
    than  the use of 0 and some nonzero value like 1 or -1.  In particular, VMS uses a different convention.

Notes:
* I've not modified the exit() calls when the returned value is different from 1 or 0 (don't break something people/tools have maybe started relying on)
* I've not modified 3rdparty/ directory, because I'm not aware of your policy about changes to 3rd party stuff.