Let all pysetup actions return a meaningful 0 or 1 exit code (#12222).

This will help scripts calling pysetup know if a command failed.
Printing/logging was also made more consistent, and a few things were
cleaned up.  In particular, the error/Ctrl-C handling was moved from the
_run function up to the main function.

The run action is not fixed yet; it returns the dist.Distribution
instance, which is needed by test_uninstall and not trivial to fix.
1 file changed