More argument checks in git2r_checkout C functions