Use the much richer exit codes from pending_updates

The details are in the comments of the script