refs.c: change update_ref to take a err argument and remove onerr

Change update_ref to take an err strbuf to return errors and remove the
onerr argument.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>