util: add xerror for calling perror and exit