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().
refs: return GIT_EMODIFIED if the ref target moved

In case we loose the race to update the reference, return GIT_EMODIFIED
to let the user distinguish it from other types of errors.