[WIP] refs: conditional ref updates

Allow updating references if the old value matches the given one.

I'm not 100% on whether `git_reference_create_if()` is a good API or not, or if we want to keep it restricted to `git_reference_set_target_if()`.

If we already have a reference (as in the case is `set_target()`), should we allow way to say "update if the old value matches the one from this object"?