Retry committing locked files on error

When a config file is open for reading (without shared-delete
permission), and then a different thread/process called
git_filebuf_commit, that would fail, even if the file was only open for
reading for a few milliseconds. This change lets git_filebuf_commit wait
up to 50ms for the file to be closed by the reader.

Fixes #2207