pkg repo signing_command: Detect if the command fails and fail early

Also cleanup exit path in cmd_sign() while here.