Consistent style of error checks in git2r C code

* All error checks now have the pattern
  if (GIT_OK != err) ...

Signed-off-by: Stefan Widgren <stefan.widgren@gmail.com>