pack: fixes to the cache The offset should be git_off_t, and we should check the return value of the mutex lock function.