libspatialindex's DiskStorageManager documentation says:
The disk storage manager uses two random access files for storing information. [...] The .idx file is loaded into main memory during initialization and is written to disk only after flushing the storage manager or during object destruction. In case of an unexpected failure changes to the storage manager will be lost due to a stale .idx file. Avoiding such disasters is future work.
... which implies that the corresponding page in the data file is updated whenever an index entry changes.
This is essentially similar to an SQLite database, except that SQLite files are not corrupted after crashes. (An SQLite storage manager seems to be an obvious extension for libspatialindex.)
I would recommend considering SQLite; if you don't like its C API, use a framework that wraps it, like for example Qt.