Fix a number of git_odb_exists_prefix bugs

The git_odb_exists_prefix API was not dealing correctly when a
later backend returned GIT_ENOTFOUND even if an earlier backend
had found the object.

Additionally, the unit tests were not properly exercising the API
and had a couple mistakes in checking the results.

Lastly, since the backends are not expected to behavior correctly
unless all bytes of the short id are zero except for the prefix,
this makes the ODB prefix APIs explicitly clear out the extra
bytes so the user doesn't have to be as careful.
Add failing test for git_object_short_id
Update clar to 4b75388
Merge pull request #2216 from ethomson/clar

Update clar to 4b75388
Don't reset need_pack

While looping over multiple heads, an up-to-date head will clobber the `remote->need_pack` setting, preventing the rest of the machinery from building and downloading a pack-file, breaking fetches.
Merge pull request #2219 from tiennou/reset-need-pack

Don't reset need_pack
Introduce git_merge_head_id
Merge pull request #2222 from ethomson/merge_head_id

Introduce git_merge_head_id
Const up members of git_merge_file_result
Merge pull request #2224 from ethomson/merge_file_const

Const up members of git_merge_file_result
Merge pull request #2178 from libgit2/rb/fix-short-id

Fix git_odb_short_id and git_odb_exists_prefix bugs
examples: Use git_object_short_id
remote: rename inmemory to anonymous and swap url and fetch order

The order in this function is the opposite to what
create_with_fetchspec() has, so change this one, as url-then-refspec is
what git does.

As we need to break compilation and the swap doesn't do that, let's take
this opportunity to rename in-memory remotes to anonymous as that's
really what sets them apart.
Merge pull request #2206 from libgit2/cmn/inmemory-swap-order

Rename in-memory remote to anonymous and swap url and fetch order
Merge pull request #2228 from mekishizufu/example_short_id

Use git_object_short_id in examples
Add CFLAGS -Wdeclaration-after-statement

This warns local variables declarations after statement, which helps not to break MSVC