Fix Intel compiler warnings

I tried building with a trial of the [Intel C Compiler](http://software.intel.com/en-us/c-compilers/), just to see what would happen. Here's my command line:

```bash
$ CC=icc cmake -DTHREADSAFE=ON ..
$ make -j 2>warnings
```

As you can see, I didn't try too hard. Here are the warnings it generates:

```
icc: command line warning #10006: ignoring unknown option '-Wno-deprecated-declarations'
```
- [ ] Properly detect gcc/clang for ignoring deprecated declarations

```
/Users/ben/src/libgit2/src/diff_tform.c(221): warning #810: conversion from "void *" to "git_hashsig_option_t={enum <unnamed>}" may lose significant bits
  	git_hashsig_option_t opt = (git_hashsig_option_t)p;
```
- [ ] Use a weird cast to avoid this?

```
/Users/ben/src/libgit2/src/index.c(2055): warning #2591: use of a const variable in a constant expression is nonstandard in C
  	header.version = htonl(is_extended ? INDEX_VERSION_NUMBER_EXT : INDEX_VERSION_NUMBER);
```
- [ ] Local variable to avoid this warning


```
ld: warning: tentative definition of '_g_repo' with size 16 from 'CMakeFiles/libgit2_clar.dir/tests/blame/buffer.c.o' is being replaced by real definition of smaller size 8 from 'CMakeFiles/libgit2_clar.dir/tests/index/addall.c.o'
```
- [x] Mark file-local variables static