refs.c: add an err argument to create_reflog

Add err argument to create_reflog that can explain the reason for a
failure. This then eliminates the need to manage errno through this
function since we can just add strerror(errno) to the err string when
meaningful. No callers relied on errno from this function for anything
else than the error message.

log_ref_write is a private function that calls create_reflog. Update
this function to also take an err argument and pass it back to the caller.
This again eliminates the need to manage errno in this function.

Update the private function write_sha1_update_reflog to also take an
err argument.

Change-Id: I0a69959b47f9261e77beac1d1923ad408eee48f9
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
refs.c: add an err argument to create_symref

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