Write an existing index object from memory back to disk using an atomic file lock.
an existing index object
0 or an error code