index: report when it's locked

Report the index being locked with its own error code in order to be
able to differentiate, as a locked index is typically the result of a
crashed process or concurrent access, both of which often require user
intervention to fix.
Merge pull request #1794 from libgit2/cmn/elocked

index: report when it's locked