Allow peeled references without trailing newline at end of file

Also ammends one of the tag tests to make sure it's working.
Seperate out a new test that verifies packed-refs with no trailing newline

as per @vmg's request
Merge pull request #1270 from libgit2/packed-peeled-objects-fix

Allow peeled references without trailing newline at end of file
Global options setter
Merge pull request #1271 from libgit2/global-settings

Global options setter
Don't clear the opt instance in the diff example.

The version field is overwritten otherwise. The opt instance is
already initialized properly.
Merge pull request #1273 from sba1/example-diff-fix

Don't clear the opt instance in the diff example.