Exit codes for -upgrade and -upgrade-check (fixes #194)