Various cleanups and tweaks

This is just me trying to wrap up a couple of old issues, namely #802 (typedefs for enums) and #989 (automatic ~ expansion for a couple of config values) plus fixing up some documentation that was either missing or unclear.

* In fixing up the enumerations, I ended up making the GIT_CONFIG_LEVEL values into an actual typedef'ed enum that would be used as a enum instead of the old behavior. I think this is better, but I'd like someone else to look it over.
* In adding documentation for the cache control values to `git_libgit2_opts()`, I added a small behavioral tweak that once the cache is turned off, every repo's cache will be cleared the next time we try to insert anything into it.
* In adding documentation for GIT_DIFF_INCLUDE_UNTRACKED_CONTENT, I added a tweak that turning on that flag will turn on GIT_DIFF_INCLUDE_UNTRACKED.
* In adding the ~ expansion, I fixed a possible bug where the attribute file cache was holding on to a config string for longer than might be safe. Now I explicitly strdup it (and free it when the cache is cleared).

I could probably separate this out into 3 different PRs (typedefs, ~ expansion, and diff docs) but each one would be tiny, so it seemed like it would be easier to just put all these tiny tweaks together and have someone take a quick peek at the whole thing...