pre-commit: Block partial commit of unlocked annexed file, since that left a typechange staged in index

I had hoped that the git devs could change git's handling of partial
commits to not use a false index file, but seems not.

So, this relies on some git internals to detect that case. The test suite
has a test case added to catch it if changes to git break it.

This commit was sponsored by Paul Tagliamonte.
Merge branch 'master' of ssh://git-annex.branchable.com