refs.c: allow passing NULL to ref_transaction_free