sha1_file.c:create_tmpfile(): Fix race when creating loose object dirs