cf-dc-api.pl: handle inventory save failures better