commit_packed_refs(): reimplement using fdopen_lock_file()