refs: conditional ref updates

Allow updating references if the old value matches the given one.
refs: changes from feedback

Change the name to _matching() intead of _if(), and force _set_target()
to be a conditional update. If the user doesn't care about the old
value, they should use git_reference_create().