refs.c: make ref_transaction_begin take an err argument